I have a fairly complex workflow. My working git branch is master
. Assume that there exists a local branch called push_branch
.
I'd like to automate the following steps whilst staying from within my working branch master
.
At a particular point in time, a commit to
master
is made with a user-specified commit message. This should trigger the following:- An additional
side_effect_file
is generated. push_branch
obtains the latest set of tracked files frommaster
. It also receives theside_effect_file
generated by the last commit made tomaster
and adds to its staging index.- A commit is made in
push_branch
(i.e. theside_effect_file
is now committed inpush_branch
. (can use the same commit message as step 0 above or use a default commit_msg, it doesn't matter). push_branch
pushes to github (or a suitable remote repo).
- An additional
Here is a pictorial description of the desired workflow:
In essence, all the working happens in master
, which acts like a one-way feed to push_branch
. The real challenge is to automate the process seamlessly, whilst staying inside the working branch master
(or at-least appears seamlessly to the user by using a shell script which runs in the background).
What I don't want to do is to manually checkout push_branch
, do a manual commit after adding side_effect_file
, issue a commit message, do a manual push and then checkout master
again. That is tedious, and not a sustainable solution.
Is this achievable? Maybe using git-worktrees
(which I don't understand well)?