- git ls-remote: displays references available in a remote repository along with the associated commit IDs.
- git remote show {remote name}: Manage the set of repositories ("remotes") whose branches you track.
- git branch | git branch -v | git branch -vv
- git fetch {remote name}
- git pull: Fetch from and integrate with another repository or a local branch.
- git checkout -b {branch} {remote name}/{remote branch name}: checks out a new local branch and sets it up to track remote branch
- git checkout --track {remote name}/{remote branch name}
- git checkout {branch name}
- git fetch: Download objects and refs from another repository.
Remote references:
- Remote references are references (pointers) in your remote repositories, including branches, tags, and so on.
Remote-tracking branches:
- Remote-tracking branches are references to the state of remote branches. They’re local references that you can’t move.
- naming: [remote name]/[remote branch name]
Tracking branches:
- Tracking branches are local branches that have a direct relationship to a remote branch.
Upstream branches:
- The branch tracking branch tracks is called an “upstream branch”.
-
'git clone [remote name]' is run? Git’s clone command
Git’s clone command automatically names it origin for you, pulls down all its data, creates a pointer to where its master branch is, and names it origin/master locally.
-
does the pointer of my remote tracking branches move?
- when you run 'git fetch [remote name]'
-
I run 'git pull'?
If you’re on a tracking branch and type git pull, Git automatically knows which server to fetch from and branch to merge into.
-
I run 'git fetch'?
While the git fetch command will fetch down all the changes on the server that you don’t have yet, it will not modify your working directory at all. It will simply get the data for you and let you merge it yourself.
-
I want to set a tracking branch and I already have a local branch?
If you already have a local branch and want to set it to a remote branch you just pulled down, or want to change the upstream branch you’re tracking, you can use the -u or --set-upstream-to option to git branch to explicitly set it at any time. git branch -u remote-name/remote-branch-name
-
I want to delete remote branch?
- You run 'git push origin --delete {remote branch name}'