>  I'm new to this and having an issue. I have a local branch origin/
> master. Using gitx I did a commit to my ProjectLocker account. Then I
> just did another commit but i guess I messed up and it just went to a
> local branch 'master'. I'm trying to instead get those changes to the
> remote branch

If I understood you correctly, your workflow appears to be invalid:
you should never ever commit anything to remote branches directly.
You only commit to local branches and then push these changes
to remote repo, if needed.

This is, indeed, a hard to understand topic because its
concepts are foreign to people coming from centralised VCSes.

Basically, it goes like this:
1) When you clone a repo, Git creates a set of branches in your
local repository which track remote branches (that is, branches found
in the remote repository).
In the simplest case, when you name your remote repository "origin",
they end up under the "origin" subdirectory, so you have "origin/
and whatever other branches are there on the remote side.
2) You never check out those branches and never modify them;
instead you base your local branches on them (using `git branch`,
`git checkout -b` etc).
For instance, if you want to base something on the remote's "master"
branch you do `git checkout -b master origin/master` (this is usually
done automatically by `git clone`). Such a branch is set up to be
"tracking" the branch it was forked off.
3) You commit changes to your local branch, and only to it,
and if/when you want to push your changes to the remote repo,
you do `git push` and git tries to send your changes to the remote
side and "append" them at the tip of that remote branch.
If this succeeds, the remote branch has exactly the same contents
as your local tracking branch.
4) Branches under "origin" are updated when you do `git fetch`
(and `git pull` as it does `git fetch` first). That is, they are
from the remote side, not by you. But *your* local branches can be
updated from them. That's how `git merge` works.

In other words, that "origin/master" is "local" only in the sense
that it is physically present on your machine, but it is not "local"
in the sense that you can modify it.
It is a "reference" branch, if you prefer.
Really local branches are those you fork manually.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to