Forums

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

Repetitive task

Peter Morgan
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!
July 26, 2023

Hi team,

I like SourceTree very much.

I'm using SourceTree on the Mac talking to BitBucket. 

 

Very often I make a change to some code in my branch. Then I end up doing these steps repeatedly..

 

1) commit button in top left

2) amend last comment and change nothing

3) commit button in bottom right

4) right click on branch

5) push to origin

 

I do that a lot. Is there a way to automate this into one single action/button? Perhaps it is there already but it seems like a common practice I'm doing and maybe others are doing the same. Might there is a way to record a macro or something to do this?

 

If you could let me know

 

Kind regards 

 

Pete

1 answer

0 votes
Martin Runge
Community Champion
August 6, 2026

Hi @Peter Morgan

Welcome to the Atlassian community!

Sourcetree doesn't have a feature to record macros, but using a Custom Action can give you that single button you're looking for. Just go to Sourcetree > Settings > Custom Actions, add a new one, and point it to your script that runs:

git commit -a --amend --no-edit && git push --force-with-lease

You can assign it a keyboard shortcut too, so your whole sequence becomes one keystroke.

If you prefer something built in, the commit view also lets you tick "Amend last commit" and Push changes immediately to origin/[branch] at the bottom, then hit Commit once. That folds the commit, amend, and push together without any scripting.

Do you frequently amend into the same commit intentionally, or do you think that doing a simple commit and push each time would meet your needs better?

Cheers, Martin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events