Skip to content

Git Commands and Proper Setup

Zach J edited this page Oct 22, 2016 · 3 revisions

Useful Git Commands

Cloning a repository

  • git clone <insert url> allows the user to clone the contents of the Github repository to their local machine

Checking/preparing files for upload to remote repository

  • git status checks the status of committed and uncommitted files
  • git add <filename> adds the specified file to the commit
  • git commit -m "<insert commit message>" prepares local files for upload to GitHub with specified message
  • git push origin dev pushes all committed files up to remote repository

Switching branches locally

  • git branch checks which branch you are working in
  • git checkout <branch name> allows you to switch to specified branch

Updating local branch from remote

  • git pull takes data from remote repository

Connecting to remote repository

  • git remote -v list current configured remote repositories
  • git remote add dev https://github.com/Jagod101/OrbitalTrajectorySimulator.git adds push/pull capabilities for the specific repository