mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
16 lines
394 B
C#
16 lines
394 B
C#
using System.IO;
|
|
|
|
namespace SourceGit.Commands
|
|
{
|
|
public static class GitIgnore
|
|
{
|
|
public static void Add(string repo, string pattern)
|
|
{
|
|
var file = Path.Combine(repo, ".gitignore");
|
|
if (!File.Exists(file))
|
|
File.WriteAllLines(file, [pattern]);
|
|
else
|
|
File.AppendAllLines(file, [pattern]);
|
|
}
|
|
}
|
|
}
|