GitHub workflow
1 min readFeb 10, 2022
Below you’ll find a beginners guide to some useful GitHub commands.
- git checkout -b <branch-name>
This command will create a new branch in your GitHub repository and automatically switch you over to the newly created branch. - git checkout <branch-name>
Switches you to whichever branch you type in. - git merge <branch-name>
Merges your code from the named branch into the current branch. - git pull origin -m
Pulls code from the current branch on GitHub if your code is not already up to date. - git add .
Stages any changes to your code to be pushed to your current branch. You can usegit addto stage a whole folder, all un-staged files, or a specific file. - git status
Shows what changes are staged to be pushed (prior command is <git add .>) - git commit -m “Comment on changes made”
Records the changes made to the files to a local repository. It’s best practice to include a message with each commit describing the changes made. - git remote
This is used to connect a local repository with a remote repository.
(git remote <command> <remote_name> <remote_URL>) - git push
Sends your local commit up to remote repository, commands 5–7–9 must be performed in this order for your code to be pushed (git add . > git commit -m “Comments” > git push) - git branch
Shows your current branch.
Get Adam Bosak’s stories in your inbox
Join Medium for free to get updates from this writer.






