Reputation: 1541
This is a situation where I needed to do.
I have a branch in my local, say testBranch (which contains a modified file file.txt
).
I've already pushed testBranch to remote by git push origin testBranch
.
So I cannot arc diff so that other people can review my code via Phabricator (since I already pushed)
What my co-worker did was create a new branch, say testBranch1 as follows:
git checkout testBranch
git merge master // merge master to testBranch
git checkout master
git pull --rebase // git pull while my local update reserved
git checkout testBranch
git merge master // merge master to testBranch
git checkout master
git merge testBranch // merge testBranch to master
git reset origin/master // set the current HEAD to origin/master in my local
git checkout -b testBranch1
arc diff
Now others can review the modified file.txt
in newBranch1 via Phabraicator. I have no idea what's going on and why this works. Could anyone explain why this works?
Upvotes: 0
Views: 3679
Reputation: 2602
Arcanist (arc
) is a pre-commit (a.k.a. pre-push) code review. Once the branch is pushed to origin, it has defeated the purpose of Arcanist. Once you have pushed, you have a few options:
git push origin --delete testBranch
.arc diff
command, tell it what you want to base it from like this: arc diff origin/master
.Upvotes: 5