The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting old commits

Ryan Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 27, 2014

Being fairly new to git and SourceTree I am noticing that a repository on a project I'm working on is starting to grow in size, probably from a whole bunch of uneccessary commits. Is there a way to delete older commits from a repository in SourceTree? There doesn't seem to be a way I can find.. or is my thinking on this an error in approach?

Thanks

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 27, 2014

Hey Ryan,

You could probably use Git Rebase to squash the commits you don't want onto ones that you want. SourceTree has the option to rebase interactively by right-clicking on a parent commit. I'd create a clone of the repository to experiment with first though.

What's your goal here? Are you wanting to remove older commits because there are a lot of individual commits and clean up the history? Or are you trying to reduce the size of the repository?

Ryan Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 28, 2014

Hey Jeff, thanks for the prompt response. How would I go about cloning the repo?

I think the goal here would be a combination of the two, reduce the size and clean up the history as well.

Regards

Like Deleted user likes this
Jeff Thomas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 28, 2014

In SourceTree if you create a new respository, you can either clone again from the remote server or from the local directory on your machine into a new path. That will create a new copy of the repository for you to experiment in.

I don't know if rebase will actually reduce the size of the repository. Do you have a lot of large non-text files committed?

Like Deleted user likes this
TAGS
AUG Leaders

Atlassian Community Events