Reputation: 577
I cloned a repository and got a master branch. From the master I created a local branch "abc". Now the remote may have progressed. The branches look like this:
>git branch -a
* abc
master
remotes/origin/HEAD -> origin/master
remotes/origin/master
Upvotes: 2
Views: 319
Reputation: 387507
git diff origin/master..abc
for a diff between origin’s master and your local abc. Note that this reflects the state of your local repository, so if you want to make sure that all new changes from the remote are there, git fetch
first.git pull
or more explicit git pull origin master
. If you want to pull to abc
you can also git fetch
first to get all remote changes into your local repository (as remote branches) and then manually merge using git merge origin/master
.git push origin <targetbranch>
. So if you want to create a branch abc
on the remote, use git push origin abc
. If you want to push to origin’s master, use git push origin master
. This will fail if the remote cannot fast forward though, in that case you need to push explicitely with --force
.Upvotes: 3