Regarding how to merge into the master branch except for the commitment of a specific user who is Git

Asked 2 years ago, Updated 2 years ago, 43 views

"With the ""squash"" option in git merge, I have committed to the master branch in bulk, but
" I would like to remove only the specific author in this commit and commit.
Is it possible?

git

2022-09-30 20:14

2 Answers

If the branch is some_branch,

$git checkout master
$ git pull
$ git rev-list --reverse --author='^(?!Taro Tanaka).*$' --perl-regexp master..some_branch | xargs git cherry-pick

Then remove the cherry-pick merge conflict and

$git reset --hard origin/master

and then

$gitmerge --squash@@{1}

I think I can do it like that.Please specify the author as your full name.


2022-09-30 20:14

git rebase-i allows each commit to

during rebase
  • Simply commit and apply
  • Squash to the last commit or
  • Wouldn't it be applied in the first place

You can choose and change the order in which you apply it.

I have to find out which author's commitment is, but I think this is the closest thing I want to do.


2022-09-30 20:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.