[英]How to resolve merge conflicts with Azure Devops and Visual Studio 2019
[英]How Can I resolve conflicts with git command line to keep target (visual studio 2019)?
與 git 合並時有很多沖突,我只想保持目標或獲取源代碼 - 有沒有辦法從 UI 或 git 命令行執行此操作,以便我可以對多個/所有文件執行此操作? 謝謝你。 Visual Studio 曾經允許我們使用 TFVC 存儲庫。
編輯:注意 - 我不想在 git 命令行上使用 -Xtheirs 或 -Xours,因為我不一定希望合並中的所有文件都與我們的或他們的自動合並 - 我想選擇哪些文件(或者首先以不同的方式合並一些文件,這樣剩下的將被自動合並為我們的或他們的)。 是否有命令或方法可以在 UI 中執行此操作,以便在合並命令之后執行此操作,而不是合並命令的一部分,因此我可以先為其他文件選擇不同的合並。
在合並命令中使用 -Xours 或 -Xtheirs 參數可以解決此問題
git merge -Xours merging_branch_name
或者
git merge -Xtheirs merging_branch_name
您可以在文件或目錄列表上使用git checkout [--ours|--theirs]
:
git checkout --ours -- file1
git checkout --theirs -- file2
git add file1 file2
# you can specify any number of patterns :
git checkout --ours -- file1 file2 dir3/ that/dir/too/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.