Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork26k
git and github tips
Andreas Mueller edited this pageNov 22, 2016 ·7 revisions
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 mastergit pull upstream mastergit rebase master feature_branch # will leave you in feature_branchgit checkout mastergit merge feature_branch # will not create a merge commit!git push upstream master
Sometimes whenever one perform a rebase, the history is messed on thegithub pull request and includes many unrelated commits.The following procedure should allow to clean the history and keep onlythe relevant commits.
git checkout mastergit fetch upstreamgit rebase upstream/mastergit checkout new-branchgit rebase mastergit log # Check that it has worked as expectedgit push -f
fetch = +refs/pull/*/head:refs/upstream/pr/*
git ls-files | xargs sed -i -e 's/old-method-name/new-method-name/g'