~/Git Commands Not In Order

Apr 10, 2022


Commands

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Initialize a Git repository with the branch name master
git init -b master

# view logs regardless of branch with a better UI
git log --all --oneline --graph

git stash push -m "Stashed commit"
git stash pop

git rebase -i HEAD~<number of commits>

git config -l # list current configuration settings 
git config -l --show-scope --show-origin
git config user.name "your name"
git config user.email "user@example.com"
git config --global user.name "your name"
git config --global user.email "user@example.com"

Flags

Flags to avoid

Configuration

1
export GIT_EDITOR=vim

References

Tags: [linux] [cli]