Skip to content

Instantly share code, notes, and snippets.

@JosiasAurel
Last active June 9, 2023 14:38
Show Gist options
  • Save JosiasAurel/3fc9f8a5af57afc632ee664ab826bd47 to your computer and use it in GitHub Desktop.
Save JosiasAurel/3fc9f8a5af57afc632ee664ab826bd47 to your computer and use it in GitHub Desktop.

Git standard commands

Configuring your git accounts locally

Setting your git username

git config --global user.name "JosiasAurel"

Setting your git email

git config --global user.email "hey@josiasw.dev"

Navigating in the terminal

cd <dir_name>

To move one directory backwards

cd ..

To create a new directory

Initializing a new git project locally

  • Initializing a new git repository locally
  git init
  • Staging a change
  git add <filename>

or use a period (.) to ask git to stage all the modified files in the current directory

  git add .
  • Commit a change
  git commit -m "commig message"
  • Push your changes to the remote counterpart by running
  git push origin main

Replace main with the name of the branch

  • Pull changes from the remote counterpart by running
  git pull origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment