Working with branches
The full power of git comes with branches.
Under construction...
To switch to a branch, use
git switch my-brach
If the branch does not exist, simply add c (for create):
git switch -c my-branch
To switch back to the branch that was active before, use
git switch -
If some changes in files have not been saved, git might not accept to switch (the files would be overwritten), so you can simply stash the changes to be able to retrieve them later once you are back on the branch
git stash save "message to descript the stash"
Then to get the changes back do
git stash pop
Last updated
Was this helpful?