新聞中心
linux/cmd命令行語法規(guī)則、語法格式
語法解釋:
<>: 必選參數(shù)
{ }: 必選參數(shù),內(nèi)部使用
[ ]: 可選參數(shù)
( ): 指明參數(shù)的默認值,只用于{ }中
|: 用于分割
… : 任意多個參數(shù)
&&:連接多個命令
--: 后跟參數(shù)名
. :當前
以git作為示例:以下是git命令所產(chǎn)生的提示信息
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.[ ]大括號代表可選參數(shù)[--version] [--help],也就是說可以直接輸入git,
創(chuàng)新互聯(lián)建站長期為上1000家客戶提供的網(wǎng)站建設(shè)服務(wù),團隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為平利企業(yè)提供專業(yè)的成都網(wǎng)站制作、網(wǎng)站設(shè)計,平利網(wǎng)站改版等技術(shù)服務(wù)。擁有十年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。
美聯(lián)儲決議http://www.gendan5.com/decision/usd.html 也可以輸入git + [ ]內(nèi)的內(nèi)容,如:git --version
2. | 代表“或者”,意為選擇一個參數(shù)[-p | --paginate | -P | --no-pager],如: git -p,git -P,git --paginate
3.<>代表必選參數(shù)[-C ],如:git -C './a.txt',path為必須輸入的內(nèi)容
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 :移除文件樹的版本控制狀態(tài)等
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 :推送當前目錄下所有更新
文章標題:用linux/cmd該怎么操作
文章轉(zhuǎn)載:http://www.ef60e0e.cn/article/ghjess.html