Git从第二个遥控器制作本地分支跟踪主控。 Github上/背页

时间:2017-03-06 10:06:41

标签: git github git-branch git-remote

我的论文在github和Overleaf。 但是在github(和本地)的主分支上,我有几个文件不被Overleaf接受,我无法推送它们。因此,我创建了另一个名为" overhoja"我删除了那些文件并更改了.gitignore。 但是,Overleaf不允许创建新分支,我必须进入背页远程的主分支。

我可以这样做:

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

总而言之,我只是希望能够分支overhoja,并且git会自动跟踪背面/主人并推动它。

谢谢!

0 个答案:

没有答案