Skip to content

Commit

Permalink
Merge pull request #8 from juliangiebel/development
Browse files Browse the repository at this point in the history
Change git checkout to be forced to discard local changes
  • Loading branch information
juliangiebel authored Sep 26, 2023
2 parents d8bcda3 + a40dca2 commit 57b3d57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SS14.MapServer/Services/GitService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void Clone(string repoUrl, string directory, string gitRef)

RunCommand(Path.GetFullPath("./..", directory), "clone --recurse-submodules", sshConfig, repoUrl);
RunCommand(directory, "fetch -fu origin", gitRef);
RunCommand(directory, "checkout", StripRef(gitRef));
RunCommand(directory, "checkout --force", StripRef(gitRef));

_log.Information("Done cloning");
}
Expand All @@ -117,7 +117,7 @@ private void Pull(string repoDirectory, string gitRef)
RunCommand(repoDirectory, "fetch -fu origin", gitRef);

_log.Debug("Checking out {Ref}", StripRef(gitRef));
RunCommand(repoDirectory, "checkout", StripRef(gitRef));
RunCommand(repoDirectory, "checkout --force", StripRef(gitRef));

_log.Debug("Pulling latest changes");
RunCommand(repoDirectory, "pull origin HEAD --ff-only --force");
Expand Down

0 comments on commit 57b3d57

Please sign in to comment.