Git Cheatsheet

·

1 min read

Initializing Git

git init

Help from Git

git help

Adding files to the git repository

git add . (for all)
git add filename.txt

Commiting changes to the git repository to keep track of it

git commit -m "Initial commit"

Logging the changes of the git repository

git log
git log -n 2 (number of commits you want to see)
git log --author="Shubham" (commit from author)
git log --since=2020-07-23
git log --until=2020-07-24

Status of the git repository

git status

Adding a remote repository

git remote add origin https://github.com/YourURL

Pushing your code to the remote repository

git push -u origin master # pushes changes to origin