Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,797
Community Members
 
Community Events
184
Community Groups

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

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

4 answers

1 accepted

4 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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).

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?

Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 12, 2015

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

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

In 3.1.3, the SourceTree I am most familiar with, there is a "Force Push" checkbox available on the screen after you click "Push" on the tool bar.  Before using it you do have to enable it by going Tools/Options/Git tab and check "Enable Force Push".

Like # people like this

Hi David,

If you are facing this issues and there are multiple files in your local branch which needs to be pulled first into your MASTER branch, then you must run '$ git pull --all' first.

Then, check the status by running "$ git status" on top of it, and if you see any modified files, then you need to 'add' and 'commit' those files first.

Once its done, you can then PUSH the changes to your MASTER branch and this will sync-up your MASTER branch with your local branch.

 

Hope this helps...!!

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

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 01, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events