gpt4 book ai didi

git - 以下git配置有什么区别

转载 作者:太空狗 更新时间:2023-10-29 13:53:45 28 4
gpt4 key购买 nike

.git/config 1

[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ssh://johndoe@example.com//repositories/plugins/myproject.git
[branch "master"]
remote = origin
merge = refs/heads/master

.git/config 2

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = ssh://johndoe@example.com//repositories/plugins/myproject.git
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "develop"]
remote = origin
merge = refs/heads/develop]

但是,在两个存储库上,当我键入 branch -a 时,都返回

git branch -a
* develop
master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/master

最佳答案

如果您尝试使用 git pull 从没有定义 [branch "develop"] 的 repo 的 develop 分支中 pull ,您将收到一个错误提示您没有指定远程分支。 Git 会建议您运行 git branch --set-upstream develop origin/develop 以创建该条目并正确跟踪远程分支。

关于git - 以下git配置有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14534558/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com