I have gone through some Q&A
In Git, what is the difference between origin/master vs origin master?
Git branching: master vs. origin/master vs. remotes/origin/master
I got to know
origin/master is a remote branch (which is a local copy of the branch named "master" on the remote named "origin")
remotes/origin/master is a branch named master on the remote named origin.
Now I want to know
- if
origin/master
is a local copy then whygit branch
does not display this branch. - can
origin/master
be treated like any other ordinary branch in local?
If not then I am in trouble. this is what I did:
I have cloned a repository. I have added a remote let say remoteA(same projet in another repo) and rebase and merge master with dev branch on remoteA. I used below command for this(current branch is master):
git pull --rebase remoteA/dev
then rebase master with origin/master
git rebase origin/master
then I created a another branch from master pushed it into remote and got successfully merged(could not push master branch as it is protected).
Now if I run git status
it says
Your branch and 'origin/master' have diverged, (use "git pull" to merge the remote branch into yours)
when I do git pull origin master
its showing all conflicts what I have resolved during rebase. Idon't wanna resolve them again. all I want is fresh copy of master without cloning it again. what did I do wrong in this process? how to correct it?
plz explain.
thanks for any help.