Back to Browse

Git and GitHub Tutorial 4 - How to do branching and merging in Git and GitHub | Git Merge

1.1K views
Jul 23, 2019
15:08

This is the fourth video of the Git and GitHub Tutorial series which covers How to do branching and merging in Git and GitHub Learning: What is a Git branch? Git branches are effectively a pointer to a snapshot of your changes. Why branching is required? 1. When you want to add a new feature or fix a bug, it is not recommended to do do changes directly to master branch(Main branch) to avoid the chances for unstable code to get merged into the main code base. So, you can create a new branch to encapsulate your changes. 2. It becomes convenient to work with multiple members in a team when each member is working on their own branch and when the code is tested to be working fine; branches can be merged to the main branch. Steps and commands for branching: Create branch - git branch “branchName” Check out branch - git checkout “branchName” Do changes/Add features in the source code on the checked out branch Commit changes to local repository - Git add "directory" , Git commit –m “commit msg” Push changes to remote repository(GitHub) - Git push –u origin “branchName” Once the code of the new branch is tested to be working successful, you need to merge your new branch to the master branch(main branch) Steps and commands for Merging to master branch: Checkout master branch - git checkout master Merge new branch to master - git merge “branchName” Push changes to remote rep - git push –u origin master After merging the new branch to the master branch, new branch is no longer required. So you can delete that branch. Steps and commands to delete the new branch: Delete from local - git branch –d “branchName” Delete from remote - git push origin –delete “branchName” ================================================================== JMeter Tutorial Playlist: https://www.youtube.com/playlist?list=PLkkGqdBS1r094KcNXRy4Q-v5biuNWv-h7 Automation Anywhere Tutorial Playlist: https://www.youtube.com/playlist?list=PLkkGqdBS1r08Fd6meBZ7zHJXA15Q5Up2w Subscribe for more tutorials - https://www.youtube.com/channel/UCFfrg66wWswpMB4vOcQPMqA?sub_confirmation=1

Download

0 formats

No download links available.

Git and GitHub Tutorial 4 - How to do branching and merging in Git and GitHub | Git Merge | NatokHD