Basic Git Commands

My basic knowlege of version controling things with git

Getting Started

To initialize a new git repository

git init This will initialize a new git repository in your current folder

To clone an existing repository

git clone <repo url> This will clone the repo found at that url. It creates a folder in your current folder.

To add a file to the git folder

git add <file name>

To commit all staged changes

git commit -m "<commit message>"

To commit all changes to local repo

git commit -ma "<commit message>"

To add a [tool.github|Github] remote repo

git remote add origin https://github.com/user/repo.git

To push to a remote repo

git push

To pull down the latest versions from a remote repo

git pull

Contact

Content is copyrighted 2019-2024 © D.S. Chapman. This site was built using GatsbyJS. Code for this website is open source and available on Github