diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-09-06 21:38:38 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-09-06 21:38:38 +0300 |
commit | 4e6d57f7f9eabc483b2f79d4d1bab5be8974020d (patch) | |
tree | 0f45ba34857dfca4f973df67451c57cf27a433e1 /Rakefile | |
parent | 3bd7a07309a502b69e7b98ad04c3e7c37362120f (diff) |
Force reset FETCH_HEAD when fetching branch
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -75,9 +75,10 @@ task :pull_repos do # Enter the temporary directory and return after block is completed. FileUtils.cd(temp_dir) do # Update repository from master. Fetch and reset to avoid - # merge conflicts - `git fetch origin #{branch}` - `git reset --hard #{branch}` + # merge conflicts. + # Why: https://gitlab.com/gitlab-com/gitlab-docs/merge_requests/119 + # How: https://stackoverflow.com/a/9589927/974710 + `git fetch origin #{branch} && git reset --hard FETCH_HEAD && git clean -df` end else puts "This shouldn't happen" |