user8872666
user8872666

Reputation: 29

failed to push some refs into repository

When I hit git command push for adding existing git repository to bitbucket newly created repository

 git push vaibhav master

    To https://bitbucket.org/thevaibhavpatil/notes_by_me.git

     ! [rejected]        master -> master (non-fast-forward)

    error: failed to push some refs to 'https://[email protected]/thevaibhavpatil/notes_by_me.git'

    hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Upvotes: 0

Views: 5870

Answers (1)

Sal-laS
Sal-laS

Reputation: 11649

So try this

git stash

git pull origin master
git add .
git commit -m "my message"
git push origin master

Upvotes: 4

Related Questions