Learn how to use git much faster with useful shortcuts.
Use the following command to change your default editor to VSCode:
git config --global core.editor "code --wait"
If you use a different editor, just Google "git set text editor to $yourEditor", it's usually easy to find.
After that you can use the following command to open the global config:
git config --global --edit
There, you can paste the commands from below.
Here is the full list of aliases from this video:
[alias]
st = status -s
sta = status
conf = config --global --edit
cge = config --global --edit
ci = commit
co = checkout
cod = checkout .
rh = reset HEAD
aa = add -A
cdf = clean -df
br = branch
bra = branch -a
pr = pull --rebase
amend = commit -a --amend --no-edit
ciam = commit -a --amend --no-edit
If you'd like to set up individual commands, you can also just paste these in your terminal:
git config --global alias.st "status -s"
git config --global alias.sta "status"
git config --global alias.conf "config --global --edit"
git config --global alias.cge "config --global --edit"
git config --global alias.ci "commit"
git config --global alias.co "checkout"
git config --global alias.cod "checkout ."
git config --global alias.rh "reset HEAD"
git config --global alias.aa "add -A"
git config --global alias.cdf "clean -df"
git config --global alias.br "branch"
git config --global alias.bra "branch -a"
git config --global alias.pr "pull --rebase"
git config --global alias.amend "commit -a --amend --no-edit"
git config --global alias.ciam "commit -a --amend --no-edit"
Video contents:
0:00 - Why aliases?
0:44 - Command Line vs GUI
1:46 - git status
2:10 - Setting your text editor
3:00 - Editing the global config
3:20 - git commit & checkout
4:15 - git reset HEAD
5:12 - Adding all changes
5:30 - git clean
5:48 - git pull --rebase
6:17 - git branch
6:27 - git commit --amend
7:24 - Full list of aliases
LEGAL DISCLAIMER
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Everything here is for informational purposes only. All non-licensed clips used for fair use commentary, criticism, and educational purposes. See Hosseinzadeh v. Klein, 276 F.Supp.3d 34 (S.D.N.Y. 2017); Equals Three, LLC v. Jukin Media, Inc., 139 F. Supp. 3d 1094 (C.D. Cal. 2015).
Негізгі бет Ғылым және технология 10 useful git aliases
Пікірлер: 73