How do I delete Pushes from Source Tree?

I got myself in some trouble here. I accidentally tried to push a big file and got an error. When I tried to reverse the commit, it just created another push. When i try to push, I blows up again. It's like there is a push log jam. How do I get rid of these unwanted pushes?

push backup.JPG

1 answer

1 vote

The Push Indicator just reflects that your local copy of the repo is # of commits ahead of the remote.

Assuming the just want to get rid of the last 2 commits, then you can right click on 3rd from last commit and choose "Reset current branch to this commit" and then decide if you want to keep any of the changed files or not, if not select the 'Hard' reset and your local repo will return to that state, before you committed the large file.

For what its worth have you looked at Git-LFS for storing large files in Git?

I was finally able to test this and it worked. Thank you. I did look at Git-LFS and that didn't solve my immediate problem. Quite frankly, I don't think data files belong on GitHub at all which is what i was trying to push in the first place. There are better solutions to that.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

798 views 0 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you