- modified(Changed File)
- untracked(New File)
- staged(Added)
- unmodified
- Add (git add gitcheat.md)//(git add .)// To Add All Files
- Commit (git commit -m "Some Message")
- push (git push origin main) // to reflect the changes in the remote repo(github repo)
- git status(to view the current status)
- Check if the folder is git repo
- ls -a (if .git not displayed then init)
- git init
- git remote add origin
- git remote -v (to verify remote)
- git branch (to check branch)// default branches - main , other branches -master,etc.
- git branch -M main (to change the branch name to main)
- git push origin main // git push -u origin main( next time you may use git push only)
- git checkout
- git checkout -b (to create a branch and move to it.)
- git branch -d
- git diff // to compare the branches
- git merge
- Create Pull Request
- git pull orogin main (to implement the remote repo changes in the local repo)
- An event when git is unable to resolve differences between the two branches
- We need to resolve the changes manually
- git log(to check all commits)//q to quit
- git reset
- git reset
- git reset HEAD~1
- git reset // the change to which we wanna move , copy its has from the git log dropdown and then paste it here
- git reset --hard // to remove the changes in code from the files as well