Tutorial by Examples

When local changes are present, the git pull command aborts reporting : error: Your local changes to the following files would be overwritten by merge In order to update (like svn update did with subversion), you can run : git stash git pull --rebase git stash pop A convenient way coul...
git fetch git reset --hard origin/master Beware: While commits discarded using reset --hard can be recovered using reflog and reset, uncommitted changes are deleted forever. Change origin and master to the remote and branch you want to forcibly pull to, respectively, if they are named different...
Rebasing when pulling If you are pulling in fresh commits from the remote repository and you have local changes on the current branch then git will automatically merge the remote version and your version. If you would like to reduce the number of merges on your branch you can tell git to rebase you...
Some problems can occur if the .git folder has wrong permission. Fixing this problem by setting the owner of the complete .git folder. Sometimes it happen that another user pull and change the rights of the .git folder or files. To fix the problem: chown -R youruser:yourgroup .git/
Simple pull When you are working on a remote repository (say, GitHub) with someone else, you will at some point want to share your changes with them. Once they have pushed their changes to a remote repository, you can retrieve those changes by pulling from this repository. git pull Will do it, ...

Page 1 of 1