Last active
March 1, 2022 20:42
-
-
Save sintret/0e676fdaca80d6ffd4b72235be85c3c6 to your computer and use it in GitHub Desktop.
Git pull with overwrite local
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG='app' pm2 start ecosystem.config.js --env production | |
##git merge## | |
git checkout master | |
git pull origin master | |
git merge test | |
git push origin master | |
##Git Reset## | |
git fetch --all | |
git reset --hard origin/master | |
OR | |
git reset --hard origin/<branch_name> | |
git checkout master | |
git branch new-branch-to-save-current-commits | |
git fetch --all | |
git reset --hard origin/master | |
After this, all of the old commits will be kept in new-branch-to-save-current-commits. | |
Uncommitted changes | |
Uncommitted changes, however (even staged), will be lost. Make sure to stash and commit anything you need. For that you can run the following: | |
git stash | |
And then to reapply these uncommitted changes: | |
git stash pop | |
https://stackoverflow.com/questions/1125968/how-do-i-force-git-pull-to-overwrite-local-files | |
#git store credentials# | |
git config --global credential.helper store | |
git pull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment