Differences
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 11:59] – [Add a new remote] rpjday | git_adding_remotes [2019/03/08 14:46] (current) – [Fetching the new remote] rpjday | ||
|---|---|---|---|
| Line 57: | Line 57: | ||
| in-pack: 6542717 | in-pack: 6542717 | ||
| packs: 1 | packs: 1 | ||
| - | size-pack: | + | size-pack: |
| prune-packable: | prune-packable: | ||
| garbage: 0 | garbage: 0 | ||
| Line 63: | Line 63: | ||
| $ | $ | ||
| </ | </ | ||
| + | |||
| + | Fetch: | ||
| + | |||
| < | < | ||
| + | $ git fetch ln | ||
| + | remote: Counting objects: 43368, done. | ||
| + | remote: Compressing objects: 100% (16663/ | ||
| + | remote: Total 43368 (delta 32248), reused 36955 (delta 26665) | ||
| + | Receiving objects: 100% (43368/ | ||
| + | Resolving deltas: 100% (32248/ | ||
| + | From https:// | ||
| + | * [new branch] | ||
| + | * [new branch] | ||
| + | * [new branch] | ||
| + | * [new branch] | ||
| + | * [new branch] | ||
| + | * [new tag] | ||
| + | $ | ||
| + | </ | ||
| + | Count objects again: | ||
| + | |||
| + | < | ||
| + | $ git count-objects -v | ||
| + | count: 0 | ||
| + | size: 0 | ||
| + | in-pack: 6586085 | ||
| + | packs: 2 | ||
| + | size-pack: 2723617 | ||
| + | prune-packable: | ||
| + | garbage: 0 | ||
| + | size-garbage: | ||
| + | $ | ||
| </ | </ | ||
| + | |||
| + | Branches: | ||
| + | |||
| + | < | ||
| + | $ git branch -a | ||
| + | * master | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | remotes/ | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ===== Working with the new remote ===== | ||
| + | |||
| + | ==== Check out a branch ==== | ||
| + | |||
| + | As long as a branch name is unique across all remotes: | ||
| + | |||
| + | < | ||
| + | $ git checkout akpm | ||
| + | Branch ' | ||
| + | Switched to a new branch ' | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | $ git branch -vv | ||
| + | * akpm | ||
| + | master 610cd4eadec4 [origin/ | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ==== Explicitly track a remote branch ==== | ||
| + | |||
| + | If there is a conflict with branch names: | ||
| + | |||
| + | < | ||
| + | $ git checkout -b lnmaster --track ln/master | ||
| + | Branch ' | ||
| + | Switched to a new branch ' | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ===== Deleting a remote ===== | ||
| + | |||
| + | < | ||
| + | $ git fsck --no-reflogs | ||
| + | Checking objects: 100% (6708499/ | ||
| + | Checking connectivity: | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | $ git remote remove ln | ||
| + | $ git remote | ||
| + | origin | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | |||