![]() ![]() It will open the editor for you to edit in the VS Code. gitconfig (under the mac home directory, hidden file), setup the following and it will help your interactive rebase. Here is the correct way to do the git interactive rebase Therefore, every time I concatenated my previous commits on top of my latest rebase commits, and the commits were getting more and more. It was because after I finish the rebase, git told me that my local feature branch diverge from remote feature branch and it asked me to merge from remote feature by git pull ( Please do not do this). There were a few duplicated commits like the following pick 50560612 A20-3308: first commit pick 0371a340 A20-3308: update failed test pick b0e46622 A20-3308: add test cases pick 19b093b9 first commit pick 1f68040d update failed test I original had 10 commits and there were 38 commits at the end after I did the rebase incorrectly after a few times repeatedly. I messed things up and the commits in rebase getting more and more. Git rebase is confusing to people who never use it and things will be messed up easily if you don’t do it properly (just like me) rebase the feature branch against develop everyday (to keep your feature branch updated with develop branch).create feature branch from develop when you start on a ticket. ![]() However, there will be a chance of conflicts if the pr don’t not merge back to develop soon enough new approach (best practice) (since the feature branch had the latest from develop branch so there weren’t any conflicts most of the time) commit, push to origin in feature branch.branch off from develop branch to a feature branch.git pull from develop after complete a feature.I seldom use interactive rebase in the git but recently I learn a best practice from co-worker and I would like to share my experience in here. Git Rebase - how to use interactive rebase properly ![]()
0 Comments
Leave a Reply. |