What are git branches? Essentially like a tree branch!
But this is a special tree. This tree not only branches, but later on down the track is capable of merging (or rebasing!) those branches back to its main trunk
Okay, maybe an arborist can chime in here.. but afaik tree branches don't usually merge back together 😆
Writing code directly to your main repository can be dangerous. Especially when you are working in a large team, where many sub-teams work on many different features!
The brilliant part of branches is that you can check out a branch to work on for example a new feature. You can let your users test that branch.
Once all is well and the new feature works as expected you can then merge it. Simple!
Using the git branch
command
1link$git branch --list OR just git branch
1link$git branch -a
1link$git branch <branchname>
1link$git branch -d <branchname>
1link$git branch -D <branchname>
For example, easily rename your master branch to main!
Home Backstory Why Git? Setting Up GitHub GitHub CLI Your GitHub Profile GitHub Pages Creating A New Repo Cloning A Repository Your First Commit Ignoring Files In Git Stashing Your Changes Branching With Git Merging Git Branches Rebasing Vs Merging Git Workflows Fork And Pull Flow Your First Pull Request Automated Security Alerts Seeing The Differences Removing/Deleting Files Reverting Your Commits Configuring your Git Commit Templates Creating Shortcuts Dotfile Management Sponsoring Open Source Handy Commands Thank You