Sync Dev with Master
December 16, 2024 ยท AI Conversations
### 1. **Switch to the Development Branch**
git checkout development
### 2. **Pull Latest Changes from Master**
git pull origin master
This command attempts to merge changes from the **master** branch into your **development** branch. If there are no conflicts, the process will complete automatically. If there are conflicts, Git will notify you.
### 3. **Resolve Merge Conflicts**
– Git will pause and show which files have conflicts. Open those files, and look for conflict markers like this:
<<<<<<< HEAD
(Your changes in the development branch)
=======
(Changes from the master branch)
>>>>>>> master
– Manually edit the file to keep the desired changes and remove the conflict markers.
### 4. **Mark Conflicts as Resolved**
After resolving conflicts in all affected files, run:
git add <file>
Repeat this for each file with conflicts, or use:
git add .
### 5. **Complete the Merge**
Once all conflicts are resolved:
git commit
Git will automatically create a merge commit message, but you can edit it if needed.
### 6. **Push the Updated Development Branch**
Finally, push the updated **development** branch to the remote repository:
git push origin development
—
If you'd like me to provide more tailored guidance for your project, let me know details about your repository, such as any specific tools or branching strategies you're using.