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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.