cherry pick - Git: move changes between branches without working directory change -
use-case: every time want move commit 1 git branch perform following sequence of actions:
- [commit working branch]
git checkout
branch-to-merge-intogit cherry-pick
target-commitgit push
git checkout
working-branch
that works fine exception - every time perform 'git checkout' git working directory content changed (expected) , causes ide (intellij idea) perform inner state update (because monitored file system sub-tree modified externally). annoys in case of big number of small commits.
i see 2 ways go:
- perform 'mass cherry picks', i.e. perform big number of commits; move them branch, say, @ working day end;
- have second local git repository , perform cherry picks on it, i.e. every time actual commit , push performed working branch, go second repository, pull changes , perform cherry pick there;
i don't first approach because possible forget move particular commit. second 1 looks bit... unnatural.
basically, perfect if git 'move commit branch name branchx branch branchx+1' without working directory update.
question: possible perform above?
no, not possible move commit between branches without changing working directory. because run conflict, @ point git pauses can fix conflict. if working directly did not represent state, not able fix conflicts correctly.
if around, find lot of other possible solutions problem on so, underlying issue sounds editor not handle files being changed out underneath it. fact of using git. so, either update editor or move more suited git workflow.
Comments
Post a Comment