What is Git and how to use it.

What is Git?

  • Git is a popular open-source version control tool commonly used for code but can be used with any type of file
  • More information about Git can be found on its website​

How do I Git it?

  • Git is typically installed by default on Linux distributions and MacOS however it will need to be installed on Windows
    • ​Git Download​
    • Windows: winget install git.git
    • Linux: sudo apt install git
    • MacOS: brew install git

Common Commands

  • Get additional syntax help git --help or man git
  • Download from a code repository such as GitHub git clone <repositoryName>
  • Create a new branch and switch to it git checkout -b <newBranchName>
  • View all branches git branch
  • Switch branches git branch <branchName>
  • View any changes made since the initial download git status
  • Queue files to be added to the branch git add <fileName> or git add *
  • Commit files git commit -m 'change comment'
  • Push files to its repository git push -u origin <branchName>