Last active
December 28, 2023 02:39
-
-
Save mikehins/63ed06a467fb8eb2ea7c to your computer and use it in GitHub Desktop.
git: sync local repo with remote one
This file contains hidden or 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
http://stackoverflow.com/questions/6373277/git-sync-local-repo-with-remote-one | |
This makes your local repo exactly like your remote repo. | |
Remember to replace origin and master with the remote and branch that you want to synchronize with. | |
git fetch origin | |
git reset --hard origin/master | |
git clean -f -d | |
#GIT UNDO | |
------ | |
$ git commit -m "Commit that needs undo" # (0) | |
------ | |
$ git reset HEAD~ # (1) | |
[ edit files as necessary ] # (2) | |
$ git add . # (3) | |
$ git commit -c ORIG_HEAD # (4) |
Nice solution, thanks.
thanks great solution to work on team like this
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you! :)