0

When I do

git branch -l   

I see my local branches, but where can I see if it was just my own branch created locally or if it is a local branch created from remote? My understanding is there is a remote branch originally. Then I created my branch off that with

git branch NAME_OF_REMOTE_BRANCH

What if I do

git branch -b NAME_OF_REMOTE_BRANCH 

What's the difference?

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
gitsensible
  • 551
  • 1
  • 8
  • 19

2 Answers2

0

This answer explains how you find out which branch is tracking which other branch, if any. If a branch is tracking any branch on origin, or whatever your remote is called, it was either directly checked out from it or the tracking branch was set manually. If you created a branch using git branch NAME_OF_REMOTE_BRANCH or git checkout -b NAME_OF_REMOTE_BRANCH, it is set to track NAME_OF_REMOTE/NAME_OF_REMOTE_BRANCH.

kowsky
  • 12,647
  • 2
  • 28
  • 41
0
git show-branch -current -r 

give your current branch history

 git branch -b not work on git,
error: unknown switch `b'

perhaps you mean git checkout -b?

in this case the command is used to create a new branch from the current one.

das-g
  • 9,718
  • 4
  • 38
  • 80
antonio Musella
  • 534
  • 1
  • 7
  • 20