简体   繁体   中英

How to sync branches in git

Please excuse my knowledge with Git as I'm new to GitHub world. I have 4 branches namely master, release, develop and staging. At this point all branches are in sync, and the I made some changes to the code and pushed from staging -> develop

Now I realise that I need to revert those changes and they should be same as release branch. I'm not sure how to do that, because when I try to do that from GitHub page it says 'There isn't anything to compare' whereas I can see the difference in files.

Could someone please assist as how to synch the staging and develop with release branch.

Git branches are not typically used to set up different build environments. The main purpose of a branch is to house functionality that is being worked on separate from the master branch. Eventually this functionality would be merged into master, with its source branch deleted. As such, it doesn't make a lot of sense to have every branch "synced" (which I assume means they are the same). If you want to house different build environments, and update them as needed, you need to look into something called DevOps. It's a related but separate concept that I highly recommend you look into after getting a grasp of the Github basics.

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