Git从第二个远程位置使本地分支跟踪主控。Github/背页
我在github和on上有我的论文。 然而,在github上的主分支(以及本地分支)上,我有几个文件不被背面接受,我无法推送它们。因此,我创建了另一个名为“overhoja”的分支,从中删除了这些文件并更改了.gitignore。 但是,不允许创建新分支,我必须将其推入背面遥控器的主分支 我可以这样做:Git从第二个远程位置使本地分支跟踪主控。Github/背页,git,github,git-branch,git-remote,Git,Github,Git Branch,Git Remote,我在github和on上有我的论文。 然而,在github上的主分支(以及本地分支)上,我有几个文件不被背面接受,我无法推送它们。因此,我创建了另一个名为“overhoja”的分支,从中删除了这些文件并更改了.gitignore。 但是,不允许创建新分支,我必须将其推入背面遥控器的主分支 我可以这样做: git push -u overleaf overhoja:master 但我的overhoja分支不知何故仍在跟踪原点/主节点 git checkout overhoja Switched
git push -u overleaf overhoja:master
但我的overhoja分支不知何故仍在跟踪原点/主节点
git checkout overhoja
Switched to branch 'overhoja'
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
我试着做:
git branch --track overhoja overleaf/master
error: the requested upstream branch 'overleaf/master' does not exist
我的配置文件如下所示:
1 [core]
2 repositoryformatversion = 0
3 filemode = true
4 bare = false
5 logallrefupdates = true
6 [remote "origin"]
7 url = git@github.com:santiagocasas/PhDThesis.git
8 fetch = +refs/heads/*:refs/remotes/origin/*
9 pushurl=git@github.com:santiagocasas/PhDThesis.git
10 [branch "master"]
11 remote = origin
12 merge = refs/heads/master
13 [remote "github"]
14 url = git@github.com:santiagocasas/PhDThesis.git
15 fetch = +refs/heads/*:refs/remotes/github/*
16 [remote "overleaf"]
17 url = https://git.overleaf.com/5886143jdywnw
18 fetch = +refs/heads/*:refs/remotes/origin/*
19 [branch "cumuthesis"]
20 remote = origin
21 merge = refs/heads/cumuthesis
22 [branch "overhoja"]
23 remote = overleaf
总而言之,我只想能够转到BranchOverhoja,git会自动跟踪Backleaf/master并推到那个位置
谢谢 您需要将本地分支设置为跟随不同的上游分支。尝试
git branch-u openleaf/master openleaf
或git branch-设置上游openleaf/master openleaf
(取决于您的git版本)您需要将本地分支设置为跟随不同的上游分支。尝试git分支-u openleaf/master openleaf
或git分支-设置上游openleaf/master openleaf
(取决于您的git版本)