Here’s how to add aliases to common Git commands
To check the status of the Git repository. git status We can see a --short or -s version with this command. git status --short For convenience, you can add git st as an alias. git config --global alias.st "status --short"
Git commands are different for different versions so be sure to check your Git version. git --version Clone a repository with submodules using the --recurse-submodules flag. This works for Git version 2.13 or higher. git clone --recurse-submodules <remote-repo-url> If the repository has a lot of submodules, then adding the -j8 flag will fetch up to 8 submodules in parallel. git clone --recurse-submodules -j8 <remote-repo-url> Alternatively, first clone the repository and then add the submodules....
Reverting your changes in Git
It’s not uncommon to make several commits during the course of developing your feature. When it’s time to push your code you want to combine all of your commits into one logical commit. When making pull requests and submitting code for review, it’s easier for others to view all of our changes in one commit rather than have them all scattered in numerous commits. To do this, we want to squash all our commits into one commit....
Review code changes before staging and committing
View code changes with git diff