How To Create Branch In Github Desktop
Creating a branch in Github Desktop client is simple, but I have seen quite a few people struggling with it when it comes to merging the branches. This article focuses on how you can do that easily. The images should help you understand the process. If you already know how to create a project and branches you can jump straight to Step 7.2.
Ensure that you have installed Github Desktop Client before proceeding.
Step 1: Create a blank project
Give an appropriate name & location for the repository and click Create Repository
.
Step 2: Create content
Create a text file for simplicity and add some text so you have something to commit on the main branch. Click Commit and Sync master
so that the changes are synced to the server.
Step 3: Publish Repository
Your local repository is ready for publishing. Hit the Publish Repository
button.
Step 4: Create Feature branch
Click on the Create New Branch
button and name the feature. Hit Create Branch
.
Step 5: Change content
Make some changes in the content and the Github client will automatically pick it up. Click Commit and Sync feature-1
button. You can continue making changes to the feature till you think it is ready to be merged into the master branch.
Step 6: Create Pull Request
While you are in the feature branch, click on the Pull Request
button. Notice that the master
< feature-1
visualization shows clearly that you are merging your master
branch from the feature-1
branch. Click Send Pull Request
.
Step 7: Merge Changes
If you look at your repository on Github.com portal, you will see a pull request.
Step 7.1
You can click on the Please pull feature 1 changes
link and merge changes using the Portal. This is easy and most likely you already know it.
Step 7.2
The same merge using the Desktop client is tricky but beneficial if you don't want to visit the portal. It is not difficult per se, but definitely not as intuitive! The following steps should help.
Step 7.2.1
Switch to the master branch.
Step 7.2.2
Tell Github to compare it with the feature branch. Click Compare
button and pick the feature branch you want to pull from.
Step 7.2.3
Click Update from feature-1
button. It seems like it will just update. But in the background, it updates and closes the pull request!
After the update, you can clearly see that changes are merged to the master branch.
Step 7.2.5
Click Sync
button and check the portal. Your pull request should be closed by now.
You can now delete the branch from the menu: Branch
> Delete feature-1
.
What next?
Well, stay tuned for upcoming articles. Say hi, share this article, leave a comment or Subscribe now to stay updated through our newsletter. Also, check out our services or contact us at contact@attosol.com for your software and consultancy requirements.
Ads:
How To Create Branch In Github Desktop
Source: https://www.attosol.com/create-and-merge-branches-using-github-desktop-client/
Posted by: knighthattlem.blogspot.com
0 Response to "How To Create Branch In Github Desktop"
Post a Comment