tags:

views:

55

answers:

1

I have a remote project that have a branch. So I first clone the repo. Then issue the following to the clone to work on a branch:

git checkout -b <name> <remote_branch_name>

Then I made the changed needed on this branch and want to commit by doing this:

git commit -a -m "changed made"

However when i want to push back to the remote branch it just say 'Everything is up to date'

git push 
Everything up-to-date

I check by clone the remote repo again in a different directory it haven't push the changes over.... So how do i push my changes back to the remote branch

Thanks

+2  A: 

That means you are somehow working on a detached head.

Make sure to fetch first the remote branch (although the clone must have taken care of that), before making your checkout.
And what remote name have you used for your starting point of your new branch?

origin/name

should work, supposing your remote repo is referenced as 'origin'.

You can see the name of the remote repo by typing:

git remote -v show

Then:

    git checkout --track 
    git checkout --track origin/abranchname

this will create a local branch 'abranchname' tracking (fetch/pull/push) the remote branch 'abranchname'.

    git branch --set-upstream abranchname origin/abranchname
VonC
How to i give a remote name to a branch? do i just checkout then do 'git remote add branch someone@machine:git.git' ? 'origin/name' that mean i should issue 'git push origin/name' ?
@charlielee: if your branch already exist, see http://stackoverflow.com/questions/520650/how-do-you-make-an-existing-git-branch-track-a-remote-branch. If this is a new tracking branch: http://stackoverflow.com/questions/1613812/git-difference-between-tracking-a-branch-versus-cloning
VonC
@chalielee: just updated my answers with various commands.
VonC