I am in my current branch say "feature/Sprint2" With the following commits:
Now i want to update my current branch to c1002 and update the current branch..after which the commits will look like:
Whats the commands?
Since you didn't tell me your situation I will consider a couple cases and give you advice on what to do in those cases.
Case 1: You want to keep the code but drop the commits
git rebase -i <c1001 commit hash>
<change the pick to fixup for c1003 and c1004>
<save your text editor>
git push -f origin feature/Sprint2
Case 2: You don't want to keep the commits or the code
git reset --hard <c1002 commit hash>
git push -f origin feature/Sprint2
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.