Branching and Merging (Web UI)

Objectives:
After completing this lab, you will be able to:

Create a branch
Commit changes to a child branch
Open a pull request
Merge a pull request into the main branch
Prerequisites:
This lab assumes that you have already created a GitHub account with a repository in it, as covered in the "Getting started with GitHub" lab.

1. Create a Branch:
To create a branch in your repository, follow these steps:

Navigate to your repository's main page.
Locate the Branch drop-down menu at the top of the file list.
Click the drop-down menu, type the name of the branch you want to create (e.g., Child_Branch), and press Enter.
Your repository now has two branches: Main and Child_Branch.
2. Add a File to a Branch:
To add a file to your new branch, follow these steps:

Ensure that the Child_Branch is selected in the Branch drop-down menu.
Click "Add file" > "Create new file" to create a new file in the repository.
Type a name and extension for the file (e.g., testchild.py) and add some content to it.
Scroll to the bottom, add an optional description, and click "Commit".
The file is now added to your Child_Branch.
3. Open a Pull Request:
To open a pull request to merge changes from the child branch into the main branch, follow these steps:

Click the "Compare & pull request" button in the Child_Branch.
Review the changes and confirm that there are no conflicts.
Optionally, add a comment to the pull request.
Click "Create pull request" to initiate the pull request.
4. Merge a Pull Request:
To merge the pull request into the main branch, follow these steps:

Click the "Pull requests" tab in your repository.
Select the pull request that you want to merge.
Review the changes and click "Merge pull request".
Confirm the merge by clicking "Confirm merge".
The pull request is now merged successfully.
Summary:
Congratulations! You've learned how to create branches, commit changes, open pull requests, and merge them into the main project. Keep practicing with branches and pull requests to become more proficient with GitHub's collaboration features.





Comments

Popular posts from this blog

Lila's Journey to Becoming a Data Scientist: Her Working Approach on the First Task

Notes on Hiring for Data Science Teams

switch functions