Skip to content

Commit 00e8c9a

Browse files
authored
add git init , update git stash
1 parent 5e140ea commit 00e8c9a

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,26 @@ Git 設定資料查看,可執行以下指令 ( 文章末會有較詳細的教
3434
git config --list
3535
```
3636

37+
## git init 指令
38+
39+
初始化 git
40+
41+
```cmd
42+
git init
43+
```
44+
45+
也可以指定資料夾
46+
47+
```cmd
48+
git init <directory>
49+
```
50+
3751
## git clone 指令
3852

3953
複製如圖位置網址 ( 不要複製我的哦~ 複製你自己的 )
4054
![alt tag](http://i.imgur.com/EJ5JNjt.jpg)
4155

42-
git clone ( 複製的網址 )
56+
git clone ( 複製的網址 ) SSH / HTTPS
4357

4458
```cmd
4559
git clone git@github.com:twtrubiks/test.git
@@ -153,7 +167,7 @@ git commit --amend
153167
git add .
154168
```
155169

156-
但是加完後發現其實有些檔案室不需要 add 進入的,這時候就可以使用如下指令去取消 add
170+
但是加完後發現其實有些檔案是不需要 add 進入的,這時候就可以使用如下指令去取消 add
157171

158172
```cmd
159173
git reset HEAD <file>
@@ -657,6 +671,12 @@ git stash list
657671
git stash pop
658672
```
659673

674+
假設今天你有很多的 stash,你可以指定,如下
675+
676+
```cmd
677+
git stash pop stash@{0}
678+
```
679+
660680
![alt tag](http://i.imgur.com/zVF7no2.jpg)
661681

662682
你會發現剛剛的東西回來了~
@@ -677,10 +697,16 @@ git stash apply
677697
git stash clear
678698
```
679699

680-
從下圖可以發現, stash 裡面的東西被我們刪除了
700+
從下圖可以發現,stash 裡面的東西被我們刪除了
681701

682702
![alt tag](http://i.imgur.com/PvzufbQ.jpg)
683703

704+
如果你想丟棄指定的 stash,可以使用
705+
706+
```cmd
707+
git stash drop stash@{0}
708+
```
709+
684710
## git 其他設定
685711

686712
我們已經設定了 user.name 以及 user.email ,但 Git 上其實還有很多可設定的東西

0 commit comments

Comments
 (0)