version control - git pull on staging server failing because of local changes -
on staging server have cron job git pull
every 2 minutes, of times works fine, notice changes pushed repo not pulled, when inspect issue , run git pull
manually error:
error: local changes following files overwritten merge: {the file(s) had pushed repo} please, commit changes or stash them before can merge.
i don't understand how these changes being considered "local changes". help?
i mentioned before ("cannot pull rebase") git rebase
learned --autostash
option (git 1.8.5+).
you combine reset --hard in order make sure end result of scheduled git upll clean state:
git config rebase.autostash true git pull -rebase git reset --hard
that assumes have no local commit or work in progress on repo updated git pull
(or erased reset --hard
)
the autostash
option ensure untracked state of working tree (for whatever reason) not blocking git pull
.
, reset --hard
should make sure working tree clean.
Comments
Post a Comment