Remote Branching Flashcards
1
Q
How to know the name of the remote server
A
git remote show
2
Q
How to get the list of remote branches
A
git remote show remote
eg remote show origin
or
git remote ls-remote
3
Q
How to create a remote branch from the local branch
A
git checkout -b new-branch
git push -u remote branch-name
4
Q
how to create a remote branch as a local branch
A
git checkout -b branch-name remote/branch-name
or
git checkout –track remote/branch name
5
Q
How to track which local branch is set up to track remote branches
A
git branch -vv
6
Q
what is ahead and behind
A
ahead - have two commits locally that are not pushed to the server
behind - commit on the server we haven’t merged in yet