Pull changes into the local repository.
-
Pull upstream changes from
<remote name>/<branch name>
and perform a rebase on current branch instead of merging it (via). Useful to update+merge pull requests.git pull --rebase <remote name> <branch name>
-
Remove remote tag
<tag name>
(via)git tag -d <tag name> git push origin :refs/tags/<tag name>
Grab a number of commits and put them on top of your current working tree.
-
last
<n>
commits from branch<branch name>
git cherry-pick B~<n>..~<branch name>
There may be merge conflicts that need to be resolved. Resolve them and continue the cherry picking via
git cherry-pick --continue
Cleanup all local, non-ignored files (that could otherwise be added via git add
).
git clean -df .
Use rebase
to origin/master or clean master branch instead of merge
for less merge commit noise in commit logs and happier contributors.
Instead of merging (during pull
)
git commit -m "work done"
git pull
merge conflicts foo
...
git commit -m "merged changes from upstream"
perform a rebase
git commit -m "work done"
git fetch origin
git rebase origin/master
merge conflicts foo
...
git rebase --continue