2018/12/07
常用 Git Command
### Initialization
```
git clone git@bitbucket.org:jessewth/xxxxx.deployment.git
git flow init -f -d
git remote add upstream git@bitbucket.org:xxxxxi/nineyi.deployment.git
```
### Remove remote branch
```
git push origin --delete feature/develop_release feature/master_for_release
```
### Clean branch cache
```
git remote prune origin
git fetch --prune
```
reference: [Git: Remove information on branches that were deleted on origin](https://makandracards.com/makandra/6739-git-remove-information-on-branches-that-were-deleted-on-origin)
### Git tag
https://git-scm.com/book/en/v2/Git-Basics-Tagging
### 還原到未修改前的狀態
```
git reset --hard
```
### 還原到未修改前的狀態及刪除未 commit 的新檔
```
git clean -fd
```
##3 用 command line 看 git log
```
git log --oneline --decorate --all --graph
```
為了方便使用, 把上述 command 加入 alias, 命名為 git tree, 下次要用的時候, 直接打 git tree 即可
```
git config --global alias.tree "log --oneline --decorate --all --graph"
```
### 回復單一個檔案的變更
```
git checkout HEAD -- ../../ConnectionStrings.config
```
### Git log search keyword
```
git log -g --grep="vsts28270"
```
訂閱:
張貼留言 (Atom)
-
一個糖果有一個糖果紙 一個糖果1元 現在商店在作促銷 3個糖果紙可以換1個糖果 請問 15元最多可以吃幾個糖果?
-
何種鐵槌?何種鏈? 何等火爐煉你的髓? 威廉.布萊克 〈老虎〉(The Tyger) 這是在圖書館翻書時看到的,我對外國文學沒有研究,上網查了一下,這首詩的意境似乎是在表達上帝與魔鬼的關係,但我單純看到這二句時,關連到的反而是軟體工匠道德聲明裡的 Practice . ...
-
在預設的情況下,中文的SQL Server的定序設定為Chinese_Taiwan_Stroke_CI_AS, 會把全形及半形視為相同字元,這會影響到我們在SUBSTRING及CARINDEX上的判斷,如果字串內同時有全形及半形的符號,SQL Server皆會把它視為相同的符號....
沒有留言:
張貼留言