亚洲国产日韩欧美一区二区三区,精品亚洲国产成人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-replace  - 創(chuàng)建,列出,刪除引用來(lái)替換對(duì)象

概要

git replace [-f] <object> <replacement>git replace [-f] --edit <object>git replace [-f] --graft <commit> [<parent>…]git replace -d <object>…
git replace [--format=<format>] [-l [<pattern>]]

描述

refs/replace/命名空間中添加一個(gè)replace引用。

replace引用的名稱是被替換的對(duì)象的 SHA-1。replace引用的內(nèi)容是替換對(duì)象的 SHA-1。

被替換的對(duì)象和替換對(duì)象必須是相同的類型。這個(gè)限制可以繞過(guò)使用-f。

除非-f給出,否則replace參考不得存在。

替換和替換對(duì)象沒(méi)有其他限制。合并提交可以被非合并提交所取代,反之亦然。

所有 Git 命令默認(rèn)使用替換引用,除了那些進(jìn)行可訪問(wèn)性遍歷(修剪,包傳輸和 fsck)的引用。

對(duì)于任何使用該--no-replace-objects選項(xiàng)的命令,可以禁用替換引用的使用git

例如,如果commit foo已經(jīng)被commitbar代替:

$ git --no-replace-objects cat-file commit foo

顯示關(guān)于提交foo的信息,同時(shí):

$ git cat-file commit foo

顯示關(guān)于提交bar的信息。

GIT_NO_REPLACE_OBJECTS環(huán)境變量可以設(shè)置為達(dá)到作為同樣的效果--no-replace-objects選項(xiàng)。

選項(xiàng)

-f   --force

如果存在對(duì)同一對(duì)象的現(xiàn)有替換引用,它將被覆蓋(而不是失?。?。

-d   --delete

刪除給定對(duì)象的現(xiàn)有替換參考。

--edit <object>

以交互方式編輯對(duì)象的內(nèi)容。將<object>的現(xiàn)有內(nèi)容打印成臨時(shí)文件,在該文件上啟動(dòng)編輯器,解析結(jié)果以創(chuàng)建與<object>具有相同類型的新對(duì)象。然后創(chuàng)建一個(gè)替換ref,用新創(chuàng)建的對(duì)象替換<object>。有關(guān)如何選擇編輯器的詳細(xì)信息,請(qǐng)參閱git-var [1]。

--raw

編輯時(shí),提供原始對(duì)象內(nèi)容而不是漂亮的內(nèi)容。目前這只影響樹(shù)木,它們將以二進(jìn)制形式顯示。這很難處理,但可以幫助修復(fù)一個(gè)如此受損的樹(shù),無(wú)法打印。請(qǐng)注意,您可能需要將您的編輯器配置為干凈地讀取和寫(xiě)入二進(jìn)制數(shù)據(jù)。

--graft <commit> <parent>…

創(chuàng)建一個(gè)嫁接提交。一個(gè)新的提交與<commit>具有相同的內(nèi)容,除了它的父母將是<parent> ...而不是<commit>的父母。然后創(chuàng)建一個(gè)替換ref,用新創(chuàng)建的提交替換<commit>。有關(guān)基于此選項(xiàng)的示例腳本,請(qǐng)參閱 contrib / convert-grafts-to-replace-refs.sh,該選項(xiàng)可以將移植替換為替換。

-l <pattern>   --list <pattern>

列表替換與給定模式匹配的對(duì)象的引用(如果沒(méi)有給出模式,則全部替換)。鍵入“git替換”不帶參數(shù),也列出所有替換參考。

--format=<format>

當(dāng)列出,使用指定的<格式>,它可以是一個(gè)short,mediumlong。省略時(shí),格式默認(rèn)為short。

格式

以下格式可用:

  • short: <replaced sha1>

  • medium: <replaced sha1> → <replacement sha1>

  • long: <replaced sha1> (<replaced type>) → <replacement sha1> (<replacement type>)

創(chuàng)建替換對(duì)象

git-filter-branch [1],git-hash-object [1]和 git-rebase [1]等 git 命令可用于從現(xiàn)有對(duì)象創(chuàng)建替換對(duì)象。--edit選項(xiàng)也可用于git replace通過(guò)編輯現(xiàn)有對(duì)象來(lái)創(chuàng)建替換對(duì)象。

如果你想要替換很多 blob,樹(shù)或提交,它們是提交字符串的一部分,你可能只想創(chuàng)建一個(gè)替換的提交字符串,然后只在提交的目標(biāo)提交字符串的頂端替換提交提交替換字符串的提示。

錯(cuò)誤

比較已經(jīng)替換它們的斑點(diǎn)或樹(shù)木將無(wú)法正常工作。并且使用git reset --hard返回到替換的提交將分支移動(dòng)到替換提交而不是替換的提交。

使用git rev-list與待處理對(duì)象相關(guān)時(shí)可能會(huì)有其他問(wèn)題。

Previous article: Next article: