When using git, I usually have to use the following commands for our workflows. Since we use repository providers with web interfaces, we usually do the server-side tasks there, however, on the local side, I do not use a visual tool, so they are all CLI 😉. I don't really list all commands, since with the ones below, git will automatically correct you if you want to do advanced things (like pushing a new branch to a remote repository).
If you need advanced functionality, all below commands come with many many options and switches, which I don't really need on a regular basis, hence did not mention. Please consult the official documentation. It's a really good source!
$ git clone example.com/repo.git: Clone a repository to your local machine$ git status: Show the status of the current repository$ git checkout develop: Change the current branch to another existing one$ git checkout -B new-branch: Change the current branch to a new one$ git branch -av: Show a list of all branches (local and remote) with a compact status on them$ git remote add upstream original-example.com/repo.git: Add a new remote source$ git remote rm upstream: Remove a remote source$ git branch -D old-branch: Delete a local branch$ git pull: Download all new commits from the remote repo$ git add file.rs: Add a new file to the version control, or stage it for commit$ git merge my-feature-branch: Merge another branch into the current one$ git commit -m "do a barrel roll": Pack all staged files into a commit and add it to the version history with a short description. By adding the -a option, you can automatically stage all added files for this commit, which makes committing a breeze!$ git rebase -i HEAD~3: Squash+Rebase. This command pulls together the last three commits into one and then replaces these three commits in the history. Using the command opens an editor, giving you additional options on how the operation should be conducted.$ git reset -- file.rs: Unstage a file$ git reset: Unstage all files$ git reset --hard: Reset the current branch to the last commit, all staged and unstaged changes are lost$ git clean -df: Removes all untracked files$ git rm file.rs: Remove a file from the version control and delete it from the file system$ git stash: Save all changes to the current repository and set it back to the last commit$ git stash pop: Merge all changes which were stashed back into the repository, removing the stash$ git push: Upload all new commits to the remote repo