1

I have Git issues (not again huuummmmpf):
I cannot push to a specific branch
I've then re-pull a re-push even a pull -rebase and re-push .

Nothing new happened.
(I've figured out a way to send my work)

Have you any field of search to suggest?

I really want to be able of resolving those issue myself in future.
Actually, not having all the answers as a student is understandable. But I am a bit lost and ressourceless with this case (and this makes me quite uncomfortable).
Where can I found clues to figure out what is happening with this damn repo.

PS: I had so many projects saved by all your efforts, so much thanks to all of you.

$ git pull origin stef

From github.com:PierreND/approfusion
 * branch            stef       -> FETCH_HEAD
Already up-to-date.

$ git pull --rebase origin stef

From github.com:PierreND/approfusion
 * branch            stef       -> FETCH_HEAD
Current branch 25_push is up to date.

$ git push origin stef

To git@github.com:PierreND/approfusion.git
 ! [rejected]        stef -> stef (non-fast-forward)
error: failed to push some refs to 'git@github.com:PierreND/approfusion.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Cœur
  • 37,241
  • 25
  • 195
  • 267
plombix
  • 396
  • 3
  • 13
  • Your current branch is "25_push", but you are trying to push stef. Try to checkout stef first, do a pull --rebase there, and then push. – VonC Nov 27 '14 at 11:48
  • holly molly ! it worked!but i dont understand 25_push whas a branch created from stef and nothing let me know this in the console message.How should i figured out this all alone?(youre really fast, thx) – plombix Nov 27 '14 at 11:57

1 Answers1

0

The git pull --rebase give you the clue:

Current branch 25_push is up to date.

That means git branch should show you the branch 25_push as being the current branch.

Switch to stef branch:

git checkout stef
git pull --rebase
git push

I would recommend setting your push policy to 'simple', in order to limit the push to only the current branch (as opposed to all the local branches)

git config --global push.default simple
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250