简体   繁体   中英

Git: Are you able to update branches after the master is changed?

Sorry about the n00b-ish questions here, but I'm not fully understanding how Git works apparently.

I have a project. I currently have three branches: Master , A , and B . Master is meant to have the newest version of the project that is released. Branches A and B were created upon the first release of the project. A is used to fix bugs in the current version while B is used to create new content for the project. I have made bug fixes using branch A and pushed them to Master (so Master now has the most recent, released version as desired).

The problem is, Branch B cannot see those fixes and so I am working with outdated code. Is there a way for me to "update" Branch B with the fixes from A without going in and copy/pasting all the code that was update?

Thanks in advance.

You need to merge the changes from Master into B :

git checkout B
git merge Master

If there are any merge conflicts, you will need to resolve them at this point and then commit the changes into B .

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM