亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore git commit-tree git count-objects git diff-index git for-each-ref git hash-object git ls-files git merge-base git read-tree git rev-list git rev-parse git show-ref git symbolic-ref git update-index git update-ref git verify-pack git write-tree Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
characters

名稱

git-check-ref-format  - 確保引用名稱格式正確

概要

git check-ref-format [--normalize]       [--[no-]allow-onelevel] [--refspec-pattern]       <refname>git check-ref-format --branch <branchname-shorthand>

描述

檢查給定refname是否可接受,如果不是,則退出非零狀態(tài)。

Git 使用引用來指定分支和標(biāo)簽。分支頭存儲(chǔ)在refs/heads層次結(jié)構(gòu)中,而標(biāo)記存儲(chǔ)在refs/tagsref命名空間的層次結(jié)構(gòu)中(通常位于$GIT_DIR/refs/heads$GIT_DIR/refs/tags目錄中,或者作為$GIT_DIR/packed-refs文件中的條目,如果引用被git gc打包)。

Git 對(duì)引用的命名方式施加了以下規(guī)則:

1. 它們可以包括/用于分層(目錄)分組的斜杠,但沒有斜線不以.開始或以.lock序列結(jié)束。

2. 它們必須包含至少一個(gè)/。這強(qiáng)制類似的heads/,tags/等存在,但是實(shí)際名稱不受限制。如果使用--allow-onelevel選項(xiàng),則放棄該規(guī)則。

3. 他們不能在..任何地方有兩個(gè)連續(xù)的點(diǎn)。

4. 它們不能具有任何位置的 ASCII 控制字符(即,其值低于\ 040或\ 177DEL的字節(jié)),空格,波浪形符號(hào)~,插入符號(hào)^或冒號(hào):。

5. 他們不能在任何地方出現(xiàn)問號(hào)?,星號(hào)*或開口支架[。有關(guān)--refspec-pattern此規(guī)則的例外情況,請(qǐng)參閱下面的選項(xiàng)。

6. 它們不能以斜杠開始或結(jié)束,/或者包含多個(gè)連續(xù)的斜杠(請(qǐng)參閱--normalize下面的選項(xiàng)以了解此規(guī)則的例外情況)

7. 它們不能以點(diǎn).結(jié)束。

8. 他們不能包含一個(gè)@{序列。

9. 他們不能是單個(gè)@角色。

10. 他們不能包含一個(gè)\。

這些規(guī)則使得基于 shell 腳本的工具可以很容易地解析引用名稱,當(dāng)引用名稱被不加引號(hào)(錯(cuò)誤地)使用引用名稱時(shí),通過 shell 進(jìn)行路徑名擴(kuò)展,并且還避免了某些引用名稱表達(dá)式中的歧義(請(qǐng)參閱gitrevisions [7]):

1. 像在ref1..ref2中經(jīng)常使用雙點(diǎn)..,在某些情況下,這個(gè)表示意味著^ref1 ref2(即不在ref1和在ref2)。

2. 腭化符號(hào)~字符和補(bǔ)注號(hào)^字符被用于引入后綴nth parentpeel onion操作。

3. 冒號(hào):被用來在srcref:dstref中表示“ 在 srccref 的值中使用 srcref的值并將其存儲(chǔ)在 dstref 中”在讀取和推送操作中。它也可以用來選擇一個(gè)特定的對(duì)象,比如 'git cat-file':“git cat-file blob v1.3.3:refs.c”。

4. at-open-brace @{被用作訪問 reflog 條目的符號(hào)。

通過--branch選項(xiàng),它可以擴(kuò)展“以前的分支語法” @{-n}。例如,@{-1}是一種引用最后一個(gè)分支的方法。這個(gè)選項(xiàng)應(yīng)該被porcelains用來在任何需要分支名稱的地方接受這個(gè)語法,所以他們可以像你輸入分支名稱一樣行事。

選項(xiàng)

--no-allow-onelevel

控制是否接受單層refnames(即不包含多個(gè)/分離組件的refnames )。默認(rèn)是--no-allow-onelevel。

--refspec-pattern

將<refname>解釋為refspec的參考名稱模式(與遠(yuǎn)程存儲(chǔ)庫一起使用)。如果這個(gè)選項(xiàng)被激活,<refname>允許含有單個(gè)*中操作的Refspec(例如,foo/bar*/bazfoo/bar*baz/而不是foo/bar*/baz*)。

--normalize

refname通過刪除任何前導(dǎo)斜杠(/)字符并將名稱組件之間相鄰斜線的運(yùn)行折疊為單斜杠來標(biāo)準(zhǔn)化。如果標(biāo)準(zhǔn)化的 refname 有效,那么將其輸出到標(biāo)準(zhǔn)輸出并以狀態(tài)0退出,否則以非零狀態(tài)退出。(--print是拼寫--normalize的不贊成的方式。)

示例

  • 打印上一個(gè)分支的名稱:$ git check-ref-format --branch @ { -  1}

  • 確定用于新分支的參考名稱:

$ ref=$(git check-ref-format --normalize "refs/heads/$newbranch")|| { echo "we do not like '$newbranch' as a branch name." >&2 ; exit 1 ; }

Previous article: Next article: