Thursday, April 6, 2023

Moving changes from one branch to another branch


Update the local repo

git pull

Goto old-branch

git branch

This will show available branches

git checkout <old-branch>

Get the feature branch updated to develop the branch state

git merge develop 

This will update the old-branch codebase to develop

If any merge conflicts are there resolve them

Checkout new-feature-branch

git checkout <new-feature-branch>

Then bring changes from  old-branch 

git merge <old-branch >

If has any local changes in the repo you can use git fetch && git checkout <branch> instead of git checkout <branch>

No comments:

Post a Comment

LeetCode C++ Cheat Sheet June

🎯 Core Patterns & Representative Questions 1. Arrays & Hashing Two Sum – hash map → O(n) Contains Duplicate , Product of A...