Is This a Good Use For Macros? Follow
Due to the recent post on Macros I decided to give them a go for the first time.
Since, using git I have been using a rebase workflow to make merging and pushing easy
e.g.
branch, work, commit etc
switch to master
update
switch to branch
rebase to master
These last 4 steps seemed to be an ideal target for a macro.
However, what I end up with after recording is:
Action.Vcs.UpdateProject
Keystroke: "ENTER"
Action: GitRebase
Is this a bug or is this not the sort of thing that the macros were targetted at?
Am I better off writing a shell script and running it as an external tool?
Please sign in to leave a comment.
The script I have written looks like this:
I have managed to create git bash as an external tool and I can run it from there, but it would be nice to be able to run it from within IDEA.
Is there any way for me to do these steps as one within IDEA or can IDEA call the script directly somehow?
Hello,
Well, 'update project' action does the same steps (you can always open 'Version Control' tool window and see the exact git commands executed under the covers).
Regarding calling the external tools - please check this page.
Denis
Hi Denis,
I don't think that IDEA, exactly duplicates this script since if I create a branch, make a few commits then try update project I get the following error:
My script finds out the name of the current branch, switches to master, updates there, then switches back to the original branch and rebases.
It doesn't matter if it is a local branch or not.
The Command Line Tools Support looks quite interesting though.
I am a little surprised that the plugin is included in PHPStorm and not IDEA Ultimate.
I guess you are more likely to need it in php work.
Anyway, it doesn't seem to work to work for me.
I get this error all the time
Also, for my script to work in the Command Line Tools toolwindow I'd have to have the git bash console loaded.
Is that possible?
Hi!
What do you input when you get error about dir? Looks like you should use command "sh <path to script>".
Also it might be more useful to use script as external tool (Settings | External Tools) with your script as program (it should be executable), ${ProjectFileDir} as working directory. Then you would be able to invoke it from various menus, and you don't need to remember exact script path.
Elena