Step 2. Create a Branch
Step 2. Create a Branch Branching is the way to work on different versions of a repository at one time.
By default your repository has one branch named master which is considered to be the definitive branch. We use branches to experiment and make edits before committing them to master.
When you create a branch off the master branch, you’re making a copy, or snapshot, of master as it was at that point in time. If someone else made changes to the master branch while you were working on your branch, you could pull in those updates.
This diagram shows:
The master branch
A new branch called feature (because we’re doing ‘feature work’ on this branch)
The journey that feature takes before it’s merged into master
Have you ever saved different versions of a file? Something like:
story.txt
story-joe-edit.txt
story-joe-edit-reviewed.txt
Branches accomplish similar goals in GitHub repositories.
Here at GitHub, our developers, writers, and designers use branches for keeping bug fixes and feature work separate from our master (production) branch. When a change is ready, they merge their branch into master.
查看评论 回复
"Step 2. Create a Branch"的相关文章
热门文章
- Popular continuous integration workflows
- Get started with GitHub Actions
- GitHub Actions
- Learn Git and GitHub without any code!
- Celebrate!
- Step 5. Merge your Pull Request
- Step 4. Open a Pull Request
- These changes will be made to just the README file
- Step 3. Make and commit changes
- To create a new branch