Logo

dev-resources.site

for different kinds of informations.

Most commonly used Git command shortcuts

Published at
1/21/2024
Categories
git
github
gitcommands
beginners
Author
Amburi Roy
Categories
4 categories in total
git
open
github
open
gitcommands
open
beginners
open
Most commonly used Git command shortcuts

I often rely on a set of Git command shortcuts that are widely used and find them quite convenient. Admittedly, it took me some time initially to become accustomed to them.

List of shortcuts:

  1. alias g='git' β€” Simplifies the Git command as 'g'.
  2. alias gs='git status' β€” Quickly check the current Git repository status.
  3. alias ga='git add' β€” Prepares changes for the next commit.
  4. alias gaa='git add .' β€” Adds all changes in the working directory to the staging area.
  5. alias gc='git commit -m' β€” Commits changes with a specified commit message.
  6. alias gca='git commit -am' β€” Adds and commits all changes in one step with a commit message.
  7. alias gco='git checkout' β€” Switches to a different branch or commit.
  8. alias gcb='git checkout -b' β€” Creates and switches to a new branch.
  9. alias gbd='git branch -d' β€” Deletes a specified branch.
  10. alias gba='git branch -a' β€” Lists all branches, including remote branches.
  11. alias gbr='git branch' β€” Lists local branches.
  12. alias gpl='git pull' β€” Fetches changes from a remote repository and merges them into the current branch.
  13. alias gph='git push' β€” Pushes changes to the remote repository.
  14. alias gpho='git push origin' β€” Pushes changes to the 'origin' remote repository.
  15. alias gl='git log --oneline' β€” Displays a simplified log of commits.
  16. alias gla='git log --oneline --decorate --graph --all' β€” Displays a detailed and graphical log of all commits.

Featured ones: