<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # git-update-ref > 原文: [https://git-scm.com/docs/git-update-ref](https://git-scm.com/docs/git-update-ref) ## 名稱 git-update-ref - 安全地更新存儲在ref中的對象名 ## 概要 ``` git update-ref [-m <reason>] [--no-deref] (-d <ref> [<oldvalue>] | [--create-reflog] <ref> <newvalue> [<oldvalue>] | --stdin [-z]) ``` ## 描述 給出兩個參數,存儲&lt; newvalue&gt;在&lt; ref&gt;中,可能取消引用符號引用。例如。 `git update-ref HEAD &lt;newvalue&gt;`將當前分支頭更新為新對象。 給出三個參數,存儲&lt; newvalue&gt;在&lt; ref&gt;中,在驗證&lt; ref&gt;的當前值之后,可能解除引用符號引用。匹配&lt; oldvalue&gt;。例如。 `git update-ref refs/heads/master &lt;newvalue&gt; &lt;oldvalue&gt;`將主分支頭更新為&lt; newvalue&gt;僅當其當前值為&lt; oldvalue&gt;時。您可以將40“0”或空字符串指定為&lt; oldvalue&gt;確保您創建的引用不存在。 它還允許“ref”文件作為指向另一個ref文件的符號指針,方法是從“ref:”的四字節頭文件序列開始。 更重要的是,它允許更新ref文件以遵循這些符號指針,無論它們是符號鏈接還是這些“常規文件符號引用”。它只跟隨**真實**符號鏈接,如果它們以“refs /”開頭:否則它只會嘗試讀取它們并將它們更新為常規文件(即它將允許文件系統跟隨它們,但會覆蓋它們符號鏈接到其他具有常規文件名的地方)。 如果給出了--no-deref,則&lt; ref&gt;本身被覆蓋,而不是遵循符號指針的結果。 一般來說,使用 ``` git update-ref HEAD "$head" ``` 應該是_很多_比做更安全 ``` echo "$head" > "$GIT_DIR/HEAD" ``` 從符合條件的符號鏈接**和**兩者都是錯誤檢查的立場。符號鏈接的“refs /”規則意味著指向樹“外部”的符號鏈接是安全的:它們將被用于讀取但不用于寫入(因此我們永遠不會通過ref符號鏈接寫入其他樹,如果您已通過創建符號鏈接樹復制了整個存檔。 使用`-d`標志,它將刪除命名的&lt; ref&gt;驗證后仍然包含&lt; oldvalue&gt;。 使用`--stdin`,update-ref從標準輸入讀取指令并一起執行所有修改。指定表單的命令: ``` update SP <ref> SP <newvalue> [SP <oldvalue>] LF create SP <ref> SP <newvalue> LF delete SP <ref> [SP <oldvalue>] LF verify SP <ref> [SP <oldvalue>] LF option SP <opt> LF ``` 使用`--create-reflog`,update-ref將為每個ref創建一個reflog,即使通常不會創建一個。 引用包含空格的字段,就好像它們是C源代碼中的字符串一樣;即,被雙引號包圍并帶有反斜杠逃逸。使用40“0”字符或空字符串指定零值。要指定缺失值,請完全省略該值及其前面的SP。 或者,使用`-z`以NUL終止格式指定,而不引用: ``` update SP <ref> NUL <newvalue> NUL [<oldvalue>] NUL create SP <ref> NUL <newvalue> NUL delete SP <ref> NUL [<oldvalue>] NUL verify SP <ref> NUL [<oldvalue>] NUL option SP <opt> NUL ``` 在此格式中,使用40“0”指定零值,并使用空字符串指定缺失值。 無論使用哪種格式,都可以以Git識別為對象名稱的任何形式指定值。任何其他格式的命令或重復的&lt; ref&gt;產生錯誤。命令含義是: ``` update ``` 設置&lt; ref&gt;到&lt; newvalue&gt;在驗證&lt; oldvalue&gt;之后,如果給出。指定零&lt; newvalue&gt;確保更新后ref不存在和/或零&lt; oldvalue&gt;確保在更新之前ref不存在。 ``` create ``` 創建&lt; ref&gt;與&lt; newvalue&gt;在驗證它不存在之后。給定的&lt; newvalue&gt;可能不是零。 ``` delete ``` 刪除&lt; ref&gt;在驗證它與&lt; oldvalue&gt;存在之后,如果給出。如果給出,&lt; oldvalue&gt;可能不是零。 ``` verify ``` 驗證&lt; ref&gt;反對&lt; oldvalue&gt;但不要改變它。如果&lt; oldvalue&gt;零或缺少,ref必須不存在。 ``` option ``` 修改命名&lt; ref&gt;的下一個命令的行為。唯一有效的選項是`no-deref`,以避免取消引用符號引用。 如果可以同時使用匹配的&lt; oldvalue&gt;來鎖定所有&lt; ref&gt;,則執行所有修改。否則,不執行任何修改。注意,雖然每個人&lt; ref&gt;以原子方式更新或刪除,并發讀者仍可以看到修改的子集。 ## 記錄更新 如果config參數“core.logAllRefUpdates”為true且ref為1,則為“refs / heads /”,“refs / remotes /”,“refs / notes /”或符號ref HEAD;或文件“$ GIT_DIR / logs /&lt; ref&gt;”然后存在`git update-ref`將一行添加到日志文件“$ GIT_DIR / logs /&lt; ref&gt;” (在創建日志名稱之前取消引用所有符號引用)描述ref值的更改。日志行的格式為: ``` oldsha1 SP newsha1 SP committer LF ``` 其中“oldsha1”是先前存儲在&lt; ref&gt;中的40字符十六進制值,“newsha1”是&lt; newvalue&gt;的40字符十六進制值。 “committer”是標準Git committer ident格式的提交者姓名,電子郵件地址和日期。 可選地使用-m: ``` oldsha1 SP newsha1 SP committer TAB message LF ``` 其中所有字段如上所述,“message”是提供給-m選項的值。 如果當前用戶無法創建新日志文件,附加到現有日志文件或沒有可用的提交者信息,則更新將失敗(不更改&lt; ref&gt;)。 ## GIT 部分 [git [1]](https://git-scm.com/docs/git) 套件
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看