update git

main
Tran Hau 2020-03-28 22:02:25 +07:00
parent 49a90190e6
commit bb88be62f1
1 changed files with 1 additions and 25 deletions

View File

@ -18,30 +18,6 @@ Push force safely:
git push --force-with-lease git push --force-with-lease
``` ```
Shallow clone:
```sh
git clone --depth 1 ...
```
Add submodule:
```sh
git submodule add --depth 1 ...
```
First time pull repo with submodules:
```sh
git submodule update --init --recursive
```
Update submodules:
```sh
git submodule update --recursive --remote
```
Save usernames and passwords in `~/.git-credentials`: Save usernames and passwords in `~/.git-credentials`:
```sh ```sh
@ -54,7 +30,7 @@ Use `vim` when commit:
git config --global core.editor vim git config --global core.editor vim
``` ```
Rewrite history: Rewrite history by changing last `x` commits :
```sh ```sh
git rebase -i HEAD~x git rebase -i HEAD~x