-
-
Save andyyou/b88d74fc180375b9ede9 to your computer and use it in GitHub Desktop.
Common commands collection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Create empty branch and copy file from another branch | |
# 這種方式複製檔案路徑會跟原本的 repository 一樣, 有點不方便 | |
$ git checkout --orphan <branchname> | |
$ git rm --cached -r . | |
$ rm -rf * | |
$ git add . | |
$ git ci -m 'comment' | |
$ git checkout <branch_name> path/to/new/file | |
# 2. Splite a folder or module to another new branch | |
$ git subtree split --prefix=<your_folder_or_module> -b <branchname> | |
# Same with above but more concise | |
$ git subtree split -P <foldername> -b <branchname> | |
# 查詢資訊 (包含設定檔案路徑)
$ gcloud info
# 設定
$ gcloud init
# 列出所有設定檔
$ gcloud config configurations list
# 刪除設定
$ gcloud config configurations delete <name>
# 切換設定
$ gcloud config configurations activate <name>
# 列出已安裝的元件
$ gcloud components list
# 安裝元件
$ gcloud components install
# 更新
$ gcloud components update
# 移除元件
gcloud components remove <component_name>
OSX mount
$ diskutil list
$ diskutil mount /dev/disk1
$ diskutil unmount /dev/disk1s2
Change filename access right for git:
$ git ls-files -m | xargs chmod 644
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add
https://localhost
to OSX