Created
August 8, 2013 10:47
-
-
Save kopwei/6183644 to your computer and use it in GitHub Desktop.
How to merge github branch and local gerrit branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Edit the local .git/config, add the following code: | |
[remote "github"] | |
fetch = +refs/heads/*:refs/remotes/github/* | |
url = git://github.com/PROJ_NAME | |
2) Check remote branches | |
git branch -r github | |
3) Check the validity | |
git remote show github | |
4) Fetch remote branches | |
git fetch github | |
5) Merge the branch | |
git branch LOCAL_BR_NAME #If local br exist | |
git checkout -b LOCAL_BR_BAME #if local br doesn't exist | |
git merge github/REMOTE_BR_NAME | |
6) Push to Gerrit | |
git push #if the branch is on gerrit already | |
git push origin BRANCH_NAME #if the branch is not there |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment