Git
What is Git and how to use it.
- Git is a popular open-source version control tool commonly used for code but can be used with any type of file
- Git is typically installed by default on Linux distributions and MacOS however it will need to be installed on Windows
- Windows:
winget install git.git
- Linux:
sudo apt install git
- MacOS:
brew install git
- Get additional syntax help
git --help
orman 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>
orgit add *
- Commit files
git commit -m 'change comment'
- Push files to its repository
git push -u origin <branchName>
Last modified 26d ago