Sublime Forum

Add a sequence of git commands

#1

How would I add a sequence of git commands for a particular repository.
For example I have one repository that needs these commands in this sequence:

git fetch upstream
git checkout master
git merge upstream/master
git push

It could be called X-Checkout, for example.

Thanks in advance for any ideas.

1 Like

#2

Create an alias for those commands like shown here https://stackoverflow.com/questions/7534184/git-alias-multiple-commands-and-parameters
Then add a custom command or menu, examples can be found in documentation e.g. https://www.sublimemerge.com/docs/command_palette

2 Likes

#3

See also Quick way to checkout remote branch after fetch? for an example.

0 Likes

#4

Thanks for the pointers. I never thought of using aliases, I’ll give it a go.

0 Likes