Git feature script
Recently, I found myself doing a lot of work on my physics analysis and pvfinder projects in my PhD and everytime I would find myself changing a lot of things on master/main branch or any other branch. Then I found myself puzzled on what to do next. usually this means opening another VSCode windows with the project and then create another branch and then modify the code to follow changes I did. I think there is probably a nicer and more elegant/efficent ways to do that. But I’m lazy in principle, so I decided to create a tool that would do that for me. At least the way I think it is simple and easy to use.
I create a bash script that will be one command like git_feature
and is in core a script that will automate branch creation, stash changes and apply changes. It requires that you soecify new branch name that will be created using --branch
or -b
. It also require a commit message because I want to force myself to actually write useful commit message instead of using some automated one. It allows me to push the new branch to the remote repository as an optional argument --push
or -p
. I usually do this and want to get back to the code before my modification so I added an option to checkout back to main
or master
(Gitlab which CERN uses still have master
by default).
The script and more information on how to use it is available here.
It is a simple script that helps me with my workflow and really solved a pain point for me. I also like to create bash scripts to automate my workflows in general.