Freelance Developer | I'm looking for work! www.icenreyes.xyz
before doing anything on a repository. I just learned this today and wanted to write it down to make it stick on my mind - or get familiar with it.
. A good practice is to name the branch with the focus of your edit.
git branch <name_of_branch>
git branch markdown
to work on your branch. Make it a habit to do small changes so it's easy to go back if you mess up.
git checkout <name_of_branch>
to see the changes on your repository.
or you can do
git add <filename>
to add all the changes instead.
git add -A
git commit -m "Your message"
. Git will compain because GitHub doesn't know about your new branch. So run
git push --set-upstream origin <branch_name>
git checkout <main_branch>
git branch -d <name_of_branch>