Skip to content

Instantly share code, notes, and snippets.

@tauren
Created July 8, 2011 04:11
Show Gist options
  • Save tauren/1071122 to your computer and use it in GitHub Desktop.
Save tauren/1071122 to your computer and use it in GitHub Desktop.
Git branch question

Ubuntu dev system (godzilla)

On my main development system, I've done a bunch of commits to master. No changes have been made to other branches. I successfully push my commits to my remote git repository.

tauren@godzilla:/projects/git/myproject$ git branch -a
* master
  remotes/origin/accounting
  remotes/origin/master
  remotes/origin/organizations
  remotes/origin/registration
  remotes/origin/test

tauren@godzilla:/projects/git/myproject$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 10 commits.
#
nothing to commit (working directory clean)
tauren@godzilla:/projects/git/sportzing$ git push
Counting objects: 331, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (145/145), done.
Writing objects: 100% (237/237), 1.39 MiB, done.
Total 237 (delta 68), reused 226 (delta 59)

MacBook Pro (creampie)

I worked with a Photoshop file, so I commit this single file and then push to my remote git repository.

creampie:myproject tauren$ git branch -a
  accounting
* master
  organizations
  registration
  remotes/origin/HEAD -> origin/master
  remotes/origin/accounting
  remotes/origin/master
  remotes/origin/organizations
  remotes/origin/registration
  remotes/origin/test

creampie:myproject tauren$ git commit -m 'small logo for schedules screen'
 [master 5066e18] logo for schedules screen
 1 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 artwork/logo-sm.psd

Error occurs while pushing:

creampie:myproject tauren$ git push
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 24.24 KiB, done.
Total 4 (delta 2), reused 0 (delta 0)
To ssh://git.myproject.com/home/tauren/myproject.git
   f8322fc..5066e18  master -> master
 ! [rejected]        accounting -> accounting (non-fast forward)
 ! [rejected]        registration -> registration (non-fast forward)
error: failed to push some refs to 'ssh://git.myproject.com/home/tauren/myproject.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'non-fast forward'
section of 'git push --help' for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment