Sitemap
Adam Bosak

Adam Bosak

GitHub workflow

1 min readFeb 10, 2022

Below you’ll find a beginners guide to some useful GitHub commands.

    Get Adam Bosak’s stories in your inbox

    Join Medium for free to get updates from this writer.

  1. 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.
  2. git checkout <branch-name>
    Switches you to whichever branch you type in.
  3. git merge <branch-name>
    Merges your code from the named branch into the current branch.
  4. git pull origin -m
    Pulls code from the current branch on GitHub if your code is not already up to date.
  5. git add .
    Stages any changes to your code to be pushed to your current branch. You can use git add to stage a whole folder, all un-staged files, or a specific file.
  6. git status
    Shows what changes are staged to be pushed (prior command is <git add .>)
  7. 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.
  8. git remote
    This is used to connect a local repository with a remote repository.
    (git remote <command> <remote_name> <remote_URL>)
  9. 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)
  10. git branch
    Shows your current branch.

--

--