Git - Remote branch (Remote Tracking Branch)

1 - About

A remote branch is a branch that is stored on a remote machine. (remote reference).

3 - Type

4 - Management

4.1 - List

git remote show [remote] 


git remote show origin

* remote origin
  Fetch URL:
  Push  URL:
  HEAD branch: master
  Remote branches:
    branch-0.5      tracked
    branch-0.6      tracked
    branch-0.7      tracked
    branch-0.8      tracked
    branch-0.9      tracked
    branch-1.0      tracked
    branch-1.0-jdbc tracked
    branch-1.1      tracked
    branch-1.2      tracked
    branch-1.3      tracked
    branch-1.4      tracked
    branch-1.5      tracked
    branch-1.6      tracked
    branch-2.0      tracked
    branch-2.1      tracked
    branch-2.2      tracked
    branch-2.3      tracked
    master          tracked
  Local branches configured for 'git pull':
    branch-2.3 merges with remote branch-2.3
    master     merges with remote master
  Local refs configured for 'git push':
    branch-2.3 pushes to branch-2.3 (up to date)
    master     pushes to master     (up to date)


4.2 - Delete

git push --delete <remote> <branchname>

4.3 - Prune

git remote prune

4.4 - Pull

To get the commit from a remote branch, you do a pull (ie a git fetch followed by git merge FETCH_HEAD)

4.5 - Fetch (Sync information locally)

A fetch will get new branch information locally (ie branch created on the remote)


git fetch

 * [new branch]      dev        -> origin/dev

To get the data in the local branch, you need to merge and if you want to do all in one move, you can just use pull

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap