簡體   English   中英

如何使用git gui重新設置基准?

[英]How to do a rebase with git gui?

我知道如何從命令行執行git rebase,但是如何使用官方的git-gui呢?

將此添加到主目錄中的.gitconfig文件中,以將重新設置命令添加到“工具”菜單中:

[guitool "Rebase onto..."]
    cmd = git rebase $REVISION
    revprompt = yes
[guitool "Rebase/Continue"]
    cmd = git rebase --continue
[guitool "Rebase/Skip"]
    cmd = git rebase --skip
[guitool "Rebase/Abort"]
    cmd = git rebase --abort
[guitool "Pull with Rebase"]
    cmd = git pull --rebase

git-gui

  1. 轉到Tools -> Add ,然后輸入自定義命令,即git rebase master
  2. 選擇全局添加以使該選項出現在所有存儲庫中。 (它將為您將配置寫入~/.gitconfig ,就像@ Ted-Percival在他的回答中提到的那樣)。

您可以使用git gui進行完整的交互式變基,並完成提交選擇,重新編寫單詞和解決沖突! 除了Ted Percival的答案外,還將其添加到您的~/.gitconfig

[guitool "Rebase interactive"]
    cmd = EDITOR=gvim git rebase -i $REVISION
    revprompt = yes

必須使用圖形編輯器-普通的舊vim不起作用,但gvim可以。 您可以使用任何gui編輯器,例如使用nedit 每當您需要輸入內容時,都會在此編輯器的單獨窗口中彈出:最初選擇提交,重新編寫提交消息(無論是重新提交還是壓入提交)等。

在進行rebase --interactive時,可以使用git gui將文件添加到索引中(如git rebase手冊頁GitHub rebase幫助頁面或此git rebase交互式技巧文章中所述 ),但不能自行執行rebase
(除非如您所見,除非您在“工具”部分中自行定義命令)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM