git merge main
git checkout main
git checkout greet
git merge main
git mergetool - this was automatic for me in vs code
git add
git commit -m "commit message"
git checkout greet
git rebase main
git checkout main
git merge greet
git rm --cached <file> deletes the file from staging and makes it "untracked"
git add --patch <file>
git log -n 2
git log --since="5 minutes ago"
"* e4e3645 2023-06-10 | Added a comment (HEAD -> main) [John Doe]"
git log --format='%h %ad | %s [%an]' --date=short HEAD -1
git checkout <master/main>
git tag
git tag -a tag-name -m "tag message"
git tag -a tag-name -m "tag message" HEAD~ or maybe HEAD~1 at the end for one before most recent commit i.e. parent commit
git checkout tag-name
git reset --hard tag-name or git reset --hard <hash> where hash is the commit aplhanumerical value
git fsck --lost-found and/or git log --all --oneline --graph --decorate
git branch -D unwanted-branchgit tag -d unwanted-tag
git reflog expire --expire=now --allas git keeps logs even for deleted branches - this clears them
git gc --prune=now --aggressive
1a. git checkout tag-name or git checkout <hash>
OR
1b. git log --all --oneline --graph --decorate
git commit --amend -m "new commit message"
git rev-parse HEAD # Get latest commit
git cat-file -p HEAD # Inspect commit object
git ls-tree HEAD # View top-level tree
git ls-tree HEAD:lib # View contents of lib/
git show HEAD:lib/hello.sh # View content of hello.sh
git log --all --decorate --oneline --graph
git checkout <branch-name>
git merge main
git reset --hard HEAD~1
git clone <url> OR
git clone <directory> <destination>
git fetch and then git mergeOR
git pull
git checkout -t origin/<remote-branch-name> - also try git checkout <remote-branch-name>
git branch -vv - literally "branch"
git remote add <remote-name> <url>
git push <remote-name> <branch-name>
git remote -v
git clone --bare <source-repo-direcrory-path> <bare-repo-name>.git
git remote add <name-bare-repo-here> <bare-repo-name>.git
git remote -v
git push --set-upstream <bare-repo-name> <master-or-main-or-prod>