BEST: git push/pull --dry-run -v
略微大意如此,但最有可能实际上回答“违约的边远存放处是什么?”
$> git push --dry-run -v
Pushing to REMOTE-URL-OR-PATH
To REMOTE-URL-OR-PATH
= [up to date] master -> master
Everything up-to-date
$> git pull --dry-run -v
From REMOTE-URL-OR-PATH
= [up to date] master -> remote_repo/master
= [up to date] other-branch -> remote_repo/remote-name-for-branch
Almost as good: git branch -vv & git remote show <remote>
<代码>git Branch -vv和git rural show <remote>
是“我如何确定违约的偏远存放处”问题的几乎答案。
<代码>git Branch -vv 不妨:
* master 41af0b6f [remote_repo/master] commit message
other-branch 1d9eb2e6 [remote_repo/branch-name-on-remote] blah blah
您可从<代码>git 边远-v找到远距的URLs或途径。
不幸的是,<代码>git Branch -vv没有告诉你你,如果你有单独的违约要求推动和支付费用。
。 例如,见以下产出。
虽然你可以尝试阅读REPO/.git/config或git config --edit
——但一般而言,有许多不同的选择和缺省组合使你的眼球融化。
TL;DR - i.e. excessive detail required because AFAIK there is no perfect answer
答案很晚,我有同样的问题。 部分可能是BKM(最知名的方法),或至少是回答这一问题的相当好的方法,分散在 st流和许多不同网站的处所。 其中许多分散的部分是不正确的,回答诸如“我如何改变违约的边远存放处?”的问题,而不是“我如何告诉违约的边远存放处是什么? 在这方面,似乎也发生了相当大的变化,增加了各种强盗指挥的新选择。 这很可能是重复的,或已在别处得到答复,但这是我在这方面发现的最简明的问题。
首先,“违约偏僻”的概念实际上属于每个分支,而不是每个存放处。 (尽管有某种组合方式,以便所有布置的存放处在设定价值后都出现同样的违约情况。) 远处。
Read git config yourself :-(
因此,你可以总是通过“git configedit”或手工编辑Your-GIT-REPO-ROOT/config来查阅你的集邮档案,寻找像样的 st。
[branch "master"]
remote = some_repo
merge = refs/heads/master
[remote "some_repo"]
url = ...
fetch = +refs/heads/*:refs/remotes/some_repo/*
然而,由于人们往往想在任何特定部门中作出不同的推卸和推推卸,因此,这已变得更加困难。 因此,你可能会看到像在混淆档案中那样的条目。
[remote "<name>"]
url = <URL>
pushurl = <pushurl>
push = <refspec>
fetch = <refspec>
或者通过重述等方法确定这种选择
remote.<branch>.pushDefault
branch.<name>.remote <-- remote.pushDefault --> <name>.pushRemote.
branch.<name>.pushRemote --overrides--> branch.<name>.remote and remote.pushDefault
branch.<name>.merge ---> branch.<name>.remote
如果你没有发现上述情况,或有时甚至没有发现,那么特别的“原始”可能或不可能用来确定你将推动或退出哪里。
BTW虽然有诸如推波夫和推土等混杂的选择,但并没有真正的选择,如拉夫诺。 由于拖拉确实是 g的,然后是merge,如果你真的想要 hand倒一切,则寻找fetch的备选办法。
! 地球资源中心是养家糊口的人,他们说“我眼球被粉碎”。
Anyway: while you can try reading your configuration, if several or many of the above configuration options are in use it can be quite difficult to determine exactly where your pushes and pulls will go to by default. Although most repositories will only have a restricted configuration, it is easy for a long-lived repository to accumulate craft that makes it difficult. IMHO the best way to determine where your pushes and pulls go is to run code on an actual computer, not simulate it in your head.
git branch -vv - better, but does not understand push/pull separation
最近的我实际上已经找到了一种自动的方法,来确定一个分支的违约推动和拉动到什么地方:git Branch -v
,其文件载于。 说:
-v
-vv
--verbose
When in list mode, show sha1 and commit subject line for each head,
along with relationship to upstream branch (if any). If given twice,
print the path of the linked worktree (if any) and the name of the
upstream branch, as well (see also git remote show <remote>
). ....
<代码>git Branch -vv 不妨:
* master 41af0b6f [remote_repo/master] commit message
other-branch 1d9eb2e6 [remote_repo/branch-name-on-remote] blah blah
边远地点是边远存放地名称的地方名称,常常是“原始”但可能还有东西。
And you can map the local name for the remote repository to its URL or filesystem pathname by git remote -v
不幸的是,这一版本的<代码>git Branch -v只了解“上游分支的名称”,没有处理推波/波拉/什么情况? 存在不同的违约情况。
git remote show <remote> - better, but maps wrong way
git remote show <remote>
provides a lot more info, including push/pull distinction - but AFAICT it only handles one <remote> at a time, so you might have to iterate over all the remotes in your repo.
* remote onedrive_repo
Fetch URL: ...
Push URL: ...
HEAD branch: master
Remote branches:
master tracked
some-other tracked
Local branches configured for git pull :
master merges with remote master
other-branch merges with remote branch_name_on_remote
Local refs configured for git push :
master pushes to master (up to date)
other-branch pushes to branch_name_on_remote
--dry-run and --verbose options are your friends
BEST: git push/pull --dry-run -v
如果你只想问问这个问题,我几乎想说——也许最好的办法。 实际也是正确的。
$> git push --dry-run -v
Pushing to REMOTE-URL-OR-PATH
To REMOTE-URL-OR-PATH
= [up to date] master -> master
Everything up-to-date
$> git pull --dry-run -v
From REMOTE-URL-OR-PATH
= [up to date] master -> remote_repo/master
= [up to date] other-branch -> remote_repo/remote-name-for-branch
Are we done yet? No... submodules
下面是另一个问题。 我在这里胜过。 页: 1 您再次是朋友。