How to find if a branch is a locally tracked branch or user created local branch?

Posted by Senthil A Kumar on Stack Overflow See other posts from Stack Overflow or by Senthil A Kumar
Published on 2010-05-22T06:59:23Z Indexed on 2010/05/25 6:41 UTC
Read the original article Hit count: 270

Filed under:
|
|

I have a remote tracking branch tracked locally in my local repository using 'git branch -b branch-name origin/branch-name'. My remote branch is test2/test2 (origin/branch-name) which is being tracked locally as test2.

The origin is also named test2. I haven't checked-out my local tracking branch test2.

When i do a 'git pull origin remote-branch:local-tracked-branch' i get this error

[test2]$ git pull test2 test2:test2 From /gitvobs/git_bare/test2 ! [rejected] test2 -> test2 (non fast forward)

Whereas when i checkout my local tracking branch test2 and do pull 'git pull origin local-tracked-branch' i don't get the error and i do a pull using 'git pull test2 test2'

From /gitvobs/git_bare/test2 * branch test2 -> FETCH_HEAD Auto-merging a.txt Automatic merge failed; fix conflicts and then commit the result.

i know that adding a + (git pull test2 +test2:test2) would help but it overwrites local changes.

So how do i know which of my local branches are created by me locally using 'git branch new-branch-name' or tracked locally from remote branches using git branch -b branch-name origin/branch-name'?

© Stack Overflow or respective owner

Related posts about git

Related posts about git-branching