Git Cheatsheet

Create a repo

git init hello-world-repo

Clone a repo

git clone [url]


git branch                  # list all local branches
git branch [branch-name]    # creates a new branch with given name
git checkout [branch-name]  # switch to given branch 


 git add .                           # Add all files
 git commit -m "commit message"      # commit 


git config --global "[email protected]"        # Global user email
git config --global "Foo Bar"             # Global user name

git config "[email protected]"        # repo specific user email
git config "Foo Bar"             # repo specific user name

git remote rm origin                       # Rmoves origin
git remote add origin # Add origin

┬ęCopyright 2020 OneCompiler | Privacy Policy | Terms & Conditions