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:
-
alias g='git'
— Simplifies the Git command as 'g'. -
alias gs='git status'
— Quickly check the current Git repository status. -
alias ga='git add'
— Prepares changes for the next commit. -
alias gaa='git add .'
— Adds all changes in the working directory to the staging area. -
alias gc='git commit -m'
— Commits changes with a specified commit message. -
alias gca='git commit -am'
— Adds and commits all changes in one step with a commit message. -
alias gco='git checkout'
— Switches to a different branch or commit. -
alias gcb='git checkout -b'
— Creates and switches to a new branch. -
alias gbd='git branch -d'
— Deletes a specified branch. -
alias gba='git branch -a'
— Lists all branches, including remote branches. -
alias gbr='git branch'
— Lists local branches. -
alias gpl='git pull'
— Fetches changes from a remote repository and merges them into the current branch. -
alias gph='git push'
— Pushes changes to the remote repository. -
alias gpho='git push origin'
— Pushes changes to the 'origin' remote repository. -
alias gl='git log --oneline'
— Displays a simplified log of commits. -
alias gla='git log --oneline --decorate --graph --all'
— Displays a detailed and graphical log of all commits.
Top comments (0)