USEFUL RESOURCES

git rebase in depth
Git branching - Rebasing
email + git workflow
How do I resolve merge conflicts in a Git repository?
Conventional Commits

most upvoted git questions on stackoverflow

Trivial question needs trivial solution

How to check out a pull (github) request locally

git fetch <remote> pull/<id>/head:<local branch>
git checkout <local branch>

# For example, to fetch the PR `#1234` from `origin` into local branch `test_pr_1234`

git fetch origin pull/1234/head:test_pr_1234
git checkout test_pr_11234

How do I delete a Git branch locally and remotely

git branch -d <branchname>
git push -d <remote> <branchname>

How can i rename a local Git branch

git branch -m <oldname (optional)> <newname>

Remove a file from a Git repository without deleting it from the local filesystem
How do I make Git forget about a file that was tracked, but is nore in .gitignore?

git rm --cached <file> # use `-r` for directory

How do I change the URI (URL) for a remote Git repository?

git remote set-url <remote> <url>

How do I remove a submodule?

git rm <path-to-submodule> # newer git version

Make an existing Git branch track a remote branch?

git branch -u <remote>/<remote_branch_name> <local_branch_name (optional)>

How do I discard unstaged changes in Git?

git restore <path-to-file or .> # newer git
git checkout -- <path-to-file or .> # older git

How do I clone all remote branches?
How can I delete a remote tag?
How do I remove local (untracked) files from the current Git working tree? (git clean)

Don't attempt to run before you learn to walk
How do I update or sync a forked repository on GitHub?
How do I checkout out a remote Git branch?
How to modify existing, unpushed commit messages?
How do I push a new local branch to a remote Git repository and track it too?

Interesting?
How do I find and restore a deleted file in a Git repository?
Move existing, uncommitted work to a new branch in Git
Move the most recent commit(s) to a new branch with Git
How do I add an empty directory to a Git repository?

Perhaps not the best thing to do
How do I delete a commit from a branch?

Understanding the concepts
What is the difference between 'git pull' and 'git fetch'?
What does cherry-picking a commit with Git mean?

Oops I fucked up
How do I undo the most recent local commits in Git
How do I undo 'git add' before commit?
How do I force 'git pull' to overwrite local files?
How do I revert a Git repository to a previous commit?
Undoing a git rebase
How can I reset or revert a file to a specific revision?
Reset local repository branch to be just like remote repository HEAD
Undo a Git merge that hasn't been pushed yet