亚洲国产日韩欧美一区二区三区,精品亚洲国产成人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-update-ref  - 安全地更新存儲(chǔ)在ref中的對(duì)象名稱

概要

git update-ref [-m <reason>] (-d <ref> [<oldvalue>] | [--no-deref] [--create-reflog] <ref> <newvalue> [<oldvalue>] | --stdin [-z])

描述

給定兩個(gè)參數(shù),將<newvalue>存儲(chǔ)在<ref>中,可能會(huì)取消引用符號(hào)引用。例如,git update-ref HEAD <newvalue>將當(dāng)前分支頭更新為新對(duì)象。

給定三個(gè)參數(shù),在驗(yàn)證<ref>的當(dāng)前值匹配<oldvalue>之后,將<newvalue>存儲(chǔ)在<ref>中,可能會(huì)解引用符號(hào)引用。例如git update-ref refs/heads/master <newvalue> <oldvalue>,只有當(dāng)它的當(dāng)前值是<oldvalue>時(shí),才將主分支頭更新為<newvalue>。您可以指定40“0”或空字符串作為<oldvalue>以確保您創(chuàng)建的引用不存在。

它還允許“ref”文件通過(guò)從“ref:”的四字節(jié)標(biāo)題序列開(kāi)始,成為另一個(gè)ref文件的符號(hào)指針。

更重要的是,它允許ref文件的更新遵循這些符號(hào)指針,無(wú)論它們是符號(hào)鏈接還是這些“常規(guī)文件符號(hào)引用”。它僅在以“refs /”開(kāi)頭時(shí)遵循真正的符號(hào)鏈接:否則它只會(huì)嘗試讀取它們并將它們更新為常規(guī)文件(即,它將允許文件系統(tǒng)跟隨它們,但會(huì)覆蓋此類符號(hào)鏈接到其他位置一個(gè)普通的文件名)。

如果給出--no-deref,則<ref>本身被覆蓋,而不是遵循符號(hào)指針的結(jié)果。

一般來(lái)說(shuō),使用

git update-ref HEAD "$head"

應(yīng)該lot比做更安全

echo "$head" > "$GIT_DIR/HEAD"

從符號(hào)鏈接錯(cuò)誤檢查的角度來(lái)看都是如此。符號(hào)鏈接的“refs /”規(guī)則意味著指向樹(shù)“外部”的符號(hào)鏈接是安全的:它們將被讀取而不是寫(xiě)入(因此,我們將永遠(yuǎn)不會(huì)通過(guò)ref符號(hào)鏈接寫(xiě)入其他樹(shù),如果您通過(guò)創(chuàng)建符號(hào)鏈接樹(shù)來(lái)復(fù)制整個(gè)存檔)。

使用-d標(biāo)志,它會(huì)在驗(yàn)證它仍包含<oldvalue>后刪除指定的<ref>。

With --stdin,update-ref從標(biāo)準(zhǔn)輸入讀取指令并一起執(zhí)行所有修改。指定表單的命令:

update SP <ref> SP <newvalue> [SP <oldvalue>] LF
create SP <ref> SP <newvalue> LFdelete SP <ref> [SP <oldvalue>] LF
verify SP <ref> [SP <oldvalue>] LF
option SP <opt> LF

與此同時(shí)--create-reflog,即使通常不會(huì)創(chuàng)建一個(gè)ref,update-ref也會(huì)為每個(gè)ref創(chuàng)建一個(gè)reflog。

引用包含空白的字段,就好像它們是C源代碼中的字符串一樣; 即由雙引號(hào)和反斜杠轉(zhuǎn)義字符包圍。使用40個(gè)“0”字符或空字符串指定一個(gè)零值。要指定缺失值,請(qǐng)完全省略該值及其前面的SP。

或者,使用-z以NUL終止的格式指定,不用引用:

update SP <ref> NUL <newvalue> NUL [<oldvalue>] NUL
create SP <ref> NUL <newvalue> NULdelete SP <ref> NUL [<oldvalue>] NUL
verify SP <ref> NUL [<oldvalue>] NUL
option SP <opt> NUL

在這種格式中,使用40“0”來(lái)指定零值,并使用空字符串指定缺失值。

無(wú)論哪種格式,值都可以以Git認(rèn)為是對(duì)象名稱的任何形式指定。任何其他格式的命令或重復(fù)的<ref>都會(huì)產(chǎn)生錯(cuò)誤。命令的含義是:

更新

如果給定,在驗(yàn)證<oldvalue>之后將<ref>設(shè)置為<newvalue>。指定一個(gè)零<newvalue>以確保ref在更新后不存在和/或一個(gè)零<oldvalue>以確保ref在更新之前不存在。

create

驗(yàn)證它不存在后,用<newvalue>創(chuàng)建<ref>。給定的<newvalue>可能不是零。

delete

如果給定,在驗(yàn)證它存在<oldvalue>之后刪除<ref>。如果給出,<oldvalue>可能不是零。

verify

驗(yàn)證<ref>與<oldvalue>,但不要更改它。如果<oldvalue>零或丟失,則ref不能存在。

option

修改命名<ref>的下一個(gè)命令的行為。唯一有效的選擇是no-deref避免取消引用符號(hào)引用。

如果所有<ref> s可以同時(shí)與匹配的<oldvalue>鎖定,則會(huì)執(zhí)行所有修改。否則,不會(huì)執(zhí)行修改。請(qǐng)注意,雖然每個(gè)單獨(dú)的<ref>以原子方式更新或刪除,但并發(fā)讀者仍可能看到修改的子集。

記錄更新

如果配置參數(shù)“core.logAllRefUpdates”為true并且ref為“refs / heads /”,“refs / remotes /”,“refs / notes /”下的符號(hào),或者符號(hào)ref HEAD; 或者存在“$ GIT_DIR / logs / <ref>”文件,則會(huì)在日志文件“$ GIT_DIR / logs / <ref>”后git update-ref添加一行(在創(chuàng)建日志名稱前解除所有符號(hào)引用),描述ref值的變化。日志行格式為:

  1. oldsha1 SP newsha1 SP提交者LF其中“oldsha1”是先前存儲(chǔ)在<ref>中的40個(gè)字符的十六進(jìn)制值,“newsha1”是<newvalue>的40個(gè)字符的十六進(jìn)制值,“committer”是提交者的姓名,電子郵件地址和日期標(biāo)準(zhǔn)的Git提交者ident格式。可選用-m:

  1. oldsha1 SP newsha1 SP 提交者 TAB 消息 LF

其中所有字段均如上所述,“消息”是提供給 -m 選項(xiàng)的值。

如果當(dāng)前用戶無(wú)法創(chuàng)建新的日志文件,追加到現(xiàn)有的日志文件或沒(méi)有可用的提交者信息,則更新將失?。ú粫?huì)更改<ref>)。

Previous article: Next article: