git init
- initialize git repogit status
- gives you the statusgit add <filename>
- adds files to staging area / indexgit commit
- commits files from staging areagit commit -m ""
- commits from git bashgit log
- shows the messages in ordergit log --oneline
- more concise version of git loggit diff
- shows you the differencegit diff --staged
- shows you the difference when files are in the staging area/ indexgit diff HEAD~<number of commit> <filename>
- shows the difference with reference to the headgit diff <commit hash> <filename>
- shows the diff with reference to the hash numbergit checkout <hash id> <filename>
- change file to earlier versiongit checkout master
- return to latest state.gitkeep
- to include an empty foldertouch
- creates a file.gitignore
- file that contains files that are to be ignoredgit add -f <foldername>/.gitkeep
- to forcefully add an empty folder
git remote add <NAME> <URL>
- name is usually origin which points to URLgit push <where> <what>
- sends local to remotegit pull <where> <what>
- pulls remote to local
How to fix master -> main
git checkout -b main
git push origin main
- fix default branch in github