您好,登錄后才能下訂單哦!
linux/cmd命令行語法規則、語法格式
語法解釋:
<>: 必選參數
{ }: 必選參數,內部使用
[ ]: 可選參數
( ): 指明參數的默認值,只用于{ }中
|: 用于分割
… : 任意多個參數
&&:連接多個命令
--: 后跟參數名
. :當前
以git作為示例:以下是git命令所產生的提示信息
C:\Users\Administrator>git
usage: git [--version] [--help] [-C ] [-c =]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[]
These are common Git commands used in various situations:
↑↑↑:
1.[ ]大括號代表可選參數[--version] [--help],也就是說可以直接輸入git,
美聯儲決議http://www.gendan5.com/decision/usd.html 也可以輸入git + [ ]內的內容,如:git --version
2. | 代表“或者”,意為選擇一個參數[-p | --paginate | -P | --no-pager],如: git -p,git -P,git --paginate
3.<>代表必選參數[-C ],如:git -C './a.txt',path為必須輸入的內容
start a working area (see also: git help tutorial)
clone Clone a repository into a new directory
init Create an empty Git repository or reinitialize an existing one
↑↑↑:倉庫操作
git clone ”http://......“;把遠程倉庫copy到本地工作副本
git clone ”http://......“;初始化一個本地git倉庫
帶用戶名密碼的clone方式:
git clone http://uname:pwd@remoteAddress
git clone http://uname:pwd@git@213245453.git
work on the current change (see also: git help everyday)
add Add file contents to the index
mv Move or rename a file, a directory, or a symlink
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
↑↑↑:本地倉庫文件版本操作
1.git add . git add ./ git add :添加文件(夾)到版本庫
2.git mv :移動或重命名
3.git reset HEAD :工作副本版本回退
4.git rm :移除文件樹的版本控制狀態等
examine the history and state (see also: git help revisions)
bisect Use binary search to find the commit that introduced a bug
grep Print lines matching a pattern
log Show commit logs
show Show various types of objects
status Show the working tree status
↑↑↑:git操作輸出信息
grow, mark and tweak your common history
branch List, create, or delete branches
checkout Switch branches or restore working tree files
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
merge Join two or more development histories together
rebase Reapply commits on top of another base tip
tag Create, list, delete or verify a tag object signed with GPG
↑↑↑:本地工作副本控制
1.git commit -am "commit msg" :提交當前目錄所有變更
2.git checkout branchname【branchname-分支名稱】切換分支
3.git diff :查看當前目錄的變更
collaborate (see also: git help workflows)
fetch Download objects and refs from another repository
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help ' or 'git help '
to read about a specific subcommand or concept.
↑↑↑:本地倉庫與遠程倉庫交互
1.git fetch :拉取更新不合并
2.git pull :拉取當前目錄下所有更新并合并本地副本
3.git push :推送當前目錄下所有更新
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。