Skip to content

git and github tips

Andreas Mueller edited this page Jul 20, 2014 · 5 revisions

Merging by rebase

This can only be done by repo collaborators. If you use the github "merge" button, a merge commit will always be created, even if the merge was fast-forward.

git checkout master
git pull upstream master
git rebase master feature_branch  # will leave you in feature_branch
git checkout master
git merge feature_branch  # will not create a merge commit!
git push upstream master

Check out pull requests to your local repo

https://gist.github.com/3342247

Find & replace in the whole repo

git grep -l 'original' | xargs sed -i '' 's/original/new/g'

Clone this wiki locally