...
For the sake of example I'll show how to merge merge b2_8_fe
into b_2_8_fe_sgi
. These are two different repositories.
...
Code Block |
---|
git clone ssh://ashehata@git.hpdd.intelwhamcloud.com:29418/fs/lustre-release-fe-sgi git checkout b2_8_fe_sgi # checkout the remote SGI branch |
...
Code Block |
---|
git remote add 2.8-fe ssh://ashehata@git.hpdd.intelwhamcloud.com:29418/fs/lustre-release-fe git pull 2.8-fe |
"2.8-fe
" is the name you give the remote repository.
...
Code Block |
---|
git merge 2.8-fe/b2_8_fe |
At this point point b2_8_fe_sgi
has been fast forwarded to to b2_8_fe
.
To list remote branches
Code Block |
---|
git branch -rrv |
To list current repositories being tracked in your local directory
Code Block |
---|
git remote |
To create a copy of a branch into another repo
Code Block |
---|
git checkout repo1/branch1 git push repo2 HEAD:branch1 |
To delete remote branch
Code Block |
---|
git push repoX :branch_to_delete |
Also when pushing to create remote branch, the HEAD
in the command above you can just be replaced with a commit hash, if you don't feel like checking out the branch.
Same works with merging, if you don't want to merge whole branch, but only up to a certain point, you can use commit hash id instead of whole branch path.
Rebases Rebase also work works against remote branches in the ways you would expect.
Git procedure to rebase and update a remote branch
Code Block |
---|
git clone ssh://ashehata@review.hpdd.intelwhamcloud.com:29418/fs/lustre-release git checkout multi-rail git fetch origin master git merge origin/master git push origin multi-rail # to grab only a few patches git checkout multi-rail git checkout <SHA> git push origin HEAD:multi-rail |
...