-3

After merging some documents, I tried git push. But it turned out to be like this:

To git@github.com:snmg-bootcamp/ChatSpace.git<br>
    ![reficted] arist -> artist(non-fast-forward)<br>
error: failed to push some refs to 'git@github.com:snmg-bootcamp/ChatSpace.git'<br>
hint: Updates were rejected because the tip of your current branch is behind <br>
hint: its remote counterpart. Intergrate the remote changes(e.g. <br>
hint: 'git pull...') before pushing again. <br>
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Can anybody tell what's the problem? I'm new.

raina77ow
  • 103,633
  • 15
  • 192
  • 229
zzalice
  • 1
  • 1
  • 2
    git is telling you what the problem is, and tells you what to do. Just read what you just posted. – JB Nizet Dec 13 '14 at 13:30

1 Answers1

0

What is the context? Are only you pushing to that branch? Do you pull changes from others into that branch on github? If no to both, then you might just need to pull first. If yes to either, then you maybe ran (dangerous) operation that changes the commit history, like git rebase or git commit --amend, which frequently require git push -f (very dangerous).

You should pull the remote branch into a new local branch to see what's wrong to compare them locally. In particular you're in a rebase-like situation if git log shows commits with similar commit messages and different hashes, tread very carefully.

Jeff Burdges
  • 4,204
  • 23
  • 46
  • I'm not the only one who push to the branch. I'd pushed once before this and fell. I did what the text said, if I didn't miss understood, and typed in "git config --global push.default matching". Then, I merge the files and push. This is the context. – zzalice Dec 13 '14 at 16:22
  • Not enough information. Just pull the remote branch into a new local branch and see if you can figure out what changed. – Jeff Burdges Dec 13 '14 at 17:34
  • Actually, I deleted the folder right after I posted this paragraph....... So I can't make sure if what you said could work. I am terribly sorry! Is there any other ways to find out what happened at that time since I'd cloned the same folder again now and all works all right. I mean, is there any way to see if I had changed the history of the folder or what? – zzalice Dec 14 '14 at 17:05