This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
git_adding_remotes [2019/03/08 12:01] rpjday [Fetching the new remote] |
git_adding_remotes [2019/03/08 14:46] (current) rpjday [Fetching the new remote] |
||
---|---|---|---|
Line 57: | Line 57: | ||
in-pack: 6542717 | in-pack: 6542717 | ||
packs: 1 | packs: 1 | ||
- | size-pack: 2684971 | + | size-pack: 2684927 |
prune-packable: 0 | prune-packable: 0 | ||
garbage: 0 | garbage: 0 | ||
Line 91: | Line 91: | ||
in-pack: 6586085 | in-pack: 6586085 | ||
packs: 2 | packs: 2 | ||
- | size-pack: 2723660 | + | size-pack: 2723617 |
prune-packable: 0 | prune-packable: 0 | ||
garbage: 0 | garbage: 0 | ||
Line 97: | Line 97: | ||
$ | $ | ||
</code> | </code> | ||
+ | |||
+ | Branches: | ||
+ | |||
+ | <code> | ||
+ | $ git branch -a | ||
+ | * master | ||
+ | remotes/ln/akpm | ||
+ | remotes/ln/akpm-base | ||
+ | remotes/ln/master | ||
+ | remotes/ln/pending-fixes | ||
+ | remotes/ln/stable | ||
+ | remotes/origin/HEAD -> origin/master | ||
+ | remotes/origin/master | ||
+ | $ | ||
+ | </code> | ||
+ | |||
+ | ===== Working with the new remote ===== | ||
+ | |||
+ | ==== Check out a branch ==== | ||
+ | |||
+ | As long as a branch name is unique across all remotes: | ||
+ | |||
+ | <code> | ||
+ | $ git checkout akpm | ||
+ | Branch 'akpm' set up to track remote branch 'akpm' from 'ln'. | ||
+ | Switched to a new branch 'akpm' | ||
+ | $ | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | $ git branch -vv | ||
+ | * akpm 02565b639c3b [ln/akpm] drivers/media/platform/sti/delta/delta-ipc.c: fix read buffer overflow | ||
+ | master 610cd4eadec4 [origin/master] Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip | ||
+ | $ | ||
+ | </code> | ||
+ | |||
+ | ==== Explicitly track a remote branch ==== | ||
+ | |||
+ | If there is a conflict with branch names: | ||
+ | |||
+ | <code> | ||
+ | $ git checkout -b lnmaster --track ln/master | ||
+ | Branch 'lnmaster' set up to track remote branch 'master' from 'ln'. | ||
+ | Switched to a new branch 'lnmaster' | ||
+ | $ | ||
+ | </code> | ||
+ | |||
+ | ===== Deleting a remote ===== | ||
+ | |||
+ | <code> | ||
+ | $ git fsck --no-reflogs | ||
+ | Checking objects: 100% (6708499/6708499), done. | ||
+ | Checking connectivity: 6708499, done. | ||
+ | $ | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | $ git remote remove ln | ||
+ | $ git remote | ||
+ | origin | ||
+ | $ | ||
+ | </code> | ||
+ | |||
+ |