Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

git and github tips

Andreas Mueller edited this pageNov 22, 2016 ·7 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 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

How to fix messed history

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

Check out pull requests to your local repo

fetch = +refs/pull/*/head:refs/upstream/pr/*

Find & replace in the whole repo

git ls-files | xargs sed -i -e 's/old-method-name/new-method-name/g'

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp