Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| git_remote_tracking_branches [2019/03/07 19:28] – [Terminology] rpjday | git_remote_tracking_branches [2019/03/08 09:43] (current) – [Simple example] rpjday | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ===== Terminology ===== | ===== Terminology ===== | ||
| - | * '' | + | * '' |
| - | * '' | + | * '' |
| * '' | * '' | ||
| Line 21: | Line 21: | ||
| nothing to commit, working tree clean | nothing to commit, working tree clean | ||
| + | $ | ||
| </ | </ | ||
| + | |||
| + | Local tracking branch: | ||
| < | < | ||
| Line 46: | Line 49: | ||
| $ | $ | ||
| </ | </ | ||
| + | |||
| + | Corresponding remote tracking branch: | ||
| < | < | ||
| Line 69: | Line 74: | ||
| # *DOCUMENTATION* | # *DOCUMENTATION* | ||
| $ | $ | ||
| + | </ | ||
| + | |||
| + | Fetch, but do not merge, which updates the remote tracking branch, but not the local tracking branch: | ||
| + | |||
| + | < | ||
| + | $ git fetch | ||
| + | remote: Counting objects: 53547, done. | ||
| + | remote: Compressing objects: 100% (20826/ | ||
| + | remote: Total 53547 (delta 38450), reused 43614 (delta 32435) | ||
| + | Receiving objects: 100% (53547/ | ||
| + | Resolving deltas: 100% (38450/ | ||
| + | From https:// | ||
| + | | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | '' | ||
| + | |||
| + | < | ||
| + | $ git status | ||
| + | On branch master | ||
| + | Your branch is behind ' | ||
| + | (use "git pull" to update your local branch) | ||
| + | |||
| + | nothing to commit, working tree clean | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | And you can show the tip of '' | ||
| + | |||
| + | < | ||
| + | $ git show origin/ | ||
| + | commit 1fc1cd8399ab5541a488a7e47b2f21537dd76c2d (origin/ | ||
| + | Merge: abf7c3d8ddea 6a613d24effc | ||
| + | Author: Linus Torvalds < | ||
| + | Date: Thu Mar 7 10:11:41 2019 -0800 | ||
| + | |||
| + | Merge branch ' | ||
| + | | ||
| + | Pull cgroup updates from Tejun Heo: | ||
| + | | ||
| + | - Oleg's pids controller accounting update which gets rid of rcu delay | ||
| + | in pids accounting updates | ||
| + | | ||
| + | - rstat (cgroup hierarchical stat collection mechanism) optimization | ||
| + | | ||
| + | - Doc updates | ||
| + | | ||
| + | * ' | ||
| + | cpuset: remove unused task_has_mempolicy() | ||
| + | cgroup, rstat: Don't flush subtree root unless necessary | ||
| + | cgroup: add documentation for pids.events file | ||
| + | Documentation: | ||
| + | MAINTAINERS: | ||
| + | cgroup/ | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | ===== Working with a remote tracking branch ===== | ||
| + | |||
| + | You can treat a remote tracking branch just like any other branch in that you can look, compare, cherry-pick and so on, but you can't check it out to make changes to it: | ||
| + | |||
| + | < | ||
| + | $ git checkout origin/ | ||
| + | Checking out files: 100% (6413/ | ||
| + | Note: checking out ' | ||
| + | |||
| + | You are in ' | ||
| + | changes and commit them, and you can discard any commits you make in this | ||
| + | state without impacting any branches by performing another checkout. | ||
| + | |||
| + | If you want to create a new branch to retain commits you create, you may | ||
| + | do so (now or later) by using -b with the checkout command again. Example: | ||
| + | |||
| + | git checkout -b < | ||
| + | |||
| + | HEAD is now at 1fc1cd8399ab Merge branch ' | ||
| + | $ | ||
| + | </ | ||
| + | |||
| + | If you want to incorporate all of that into your local tracking branch, you can just: | ||
| + | |||
| + | < | ||
| + | $ git checkout master | ||
| + | $ git merge origin/ | ||
| </ | </ | ||