It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I cant push my changes because of something I might have done

David Scott Jan 01, 2015

Hello, I’m trying to push some changes but I keep getting this message: ‘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.’

The problem is that I don’t want to pull any changes before pushing as that version contains a bug I'm trying to avoid.

This issue could be due to me doing something in Sourcetree when trying to go back to a previous commit that left me with this purple line/branch: https://dl.dropboxusercontent.com/u/8176796/Screen%20Shot%202015-01-01%20at%2011.45.40.png

Many thanks

David

3 answers

1 accepted

3 votes
Answer accepted
Seth Jan 08, 2015

If you are ok with losing the buggy commit completely, you can "force" the push (http://stackoverflow.com/questions/5509543/how-do-i-properly-force-a-git-push).

If anyone else has also cloned the repo, their git client will git very confused the next time they fetch/pull. If that is your situation, you might consider doing the pull/merge, then "reversing" the buggy commit (basically creates a new commit that does the opposite of the changes in the commit that is being reversed).

David Scott Jan 10, 2015

Hello Seth, I work alone so I don't think those issues would be a problem but I couldn't seem to find any 'force' option after I clicked on Push?

Balazs Szakmary Jan 11, 2015

There is no force push option in SourceTree. You have to do this from the command line or another Git client (e.g. Git Extensions).

Seth Jan 12, 2015

Balazs is right, my bad. I updated my answer with a link on how to do this from the command line.

David Scott Jan 24, 2015

Thanks guys, it took a while but it worked in the end :)

0 votes
Seth Jan 01, 2015

Are you wanting to force the buggy commit in the remote to be lost?

0 votes
David Scott Jan 08, 2015

Hi Sorry I missed this, yes please thats exactly what I'm looking for :)

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Sourcetree

[dev team] Sourcetree for Windows 2019 Preview - Dark Theme

Hi folks, While the full post is over on our blog I'd like to share the dark theme we've got planned for 2019 here directly as well to keep the discussion going.  The ...

1,932 views 14 18
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you