我想查看https://github.com/PHPOffice/PHPWord开发人员分支。但是我只在本地计算机上看到过时的文件,并且没有从服务器获取最近修改过的文件。 已合并文件“CONTRIBUTING.md”上的拉取请求: https://github.com/PHPOffice/PHPWord/commit/48322ca89c09ad2bb2f5f6bb1fc60b872bde8c16 但我无法将此版本的文件提取到本地计算机。
我用'git pull'和'git fetch'尝试了几乎所有的东西。
[franz@localhost PHPWord (develop)]$ git pull origin develop
From https://github.com/franzholz/PHPWord
* branch develop -> FETCH_HEAD
Already up-to-date.
[franz@localhost PHPWord (develop)]$ git pull upstream develop
From https://github.com/franzholz/PHPWord
* branch develop -> FETCH_HEAD
Already up-to-date.
我已阅读并确实关注了几个Git教程以及关于Git的这个问题: How to clone all remote branches in Git?
如果我打开网站:
https://github.com/PHPOffice/PHPWord/blob/develop/CONTRIBUTING.md
然后我在第一行看到“欢迎每一个贡献”的文字。
在我的本地机器上执行。
[franz@localhost PHPWord (develop)]$ head -3 CONTRIBUTING.md
# Contributing to PHPWord
PHPWord is build by the crowd and for the crowd. Every contributions are welcomed; either by [submitting](https://github.com/PHPOffice/PHPWord/issues) bug issues or suggesting improvements, or in a more active form like [requesting](https://github.com/PHPOffice/PHPWord/pulls) a pull.
这里总是过时而不是固定的文字:“欢迎每一份贡献”。
我在Github上的分叉也已经过时了。 https://github.com/franzholz/PHPWord/blob/develop/CONTRIBUTING.md 如何在服务器端更新此分支?
Github帮助“同步分叉”:
[franz@localhost PHPWord (develop)]$ git merge upstream/develop
Already up-to-date.
我被困在这里。我想看看真正修复的文件,因为它在开发分支的Git在线存储库中。我很确定我的本地开发分支已经连接到远程开发分支。但是如何使用我的文件系统来查看名为“CONTRIBUTING.md”的真实新文件?
[franz@localhost PHPWord (develop)]$ git remote show origin
* distante origin
URL de rapatriement : https://github.com/franzholz/PHPWord.git
URL push : https://github.com/franzholz/PHPWord.git
Branche HEAD : develop
Branches distantes :
develop suivi
gh-pages suivi
master suivi
patch-1 suivi
patch-2 suivi
Branches locales configurées pour 'git pull' :
develop fusionne avec la distante develop
master fusionne avec la distante master
Références locales configurées pour 'git push' :
develop pousse vers develop (à jour)
master pousse vers master (à jour)
[franz@localhost PHPWord (develop)]$ ls -l
total 256
-rw-r--r-- 1 franz live 21042 sept. 18 13:23 CHANGELOG.md
-rw-r--r-- 1 franz live 1979 sept. 18 13:23 composer.json
-rw-r--r-- 1 franz live 131936 sept. 18 13:23 composer.lock
-rw-r--r-- 1 franz live 1876 sept. 17 20:16 CONTRIBUTING.md
-rw-r--r-- 1 franz live 35147 sept. 17 20:16 COPYING
-rw-r--r-- 1 franz live 7651 sept. 17 20:16 COPYING.LESSER
drwxr-xr-x 4 franz live 4096 sept. 18 13:51 docs/
-rw-r--r-- 1 franz live 688 sept. 17 20:16 LICENSE
-rw-r--r-- 1 franz live 1185 sept. 18 13:23 phpmd.xml.dist
-rw-r--r-- 1 franz live 970 sept. 17 20:16 phpunit.xml.dist
-rw-r--r-- 1 franz live 303 sept. 18 13:23 phpword.ini.dist
-rw-r--r-- 1 franz live 7589 sept. 18 13:23 README.md
drwxr-xr-x 5 franz live 4096 sept. 18 13:23 samples/
drwxr-xr-x 3 franz live 4096 sept. 17 20:16 src/
drwxr-xr-x 3 franz live 4096 sept. 17 20:16 tests/
-rw-r--r-- 1 franz live 6 sept. 18 13:23 VERSION
[franz@localhost PHPWord (develop)]$ git log
commit bf0136c15680266bc31bcb662809843162f7b11d
Author: Roman Syroeshko <syroeshkoro@gmail.com>
Date: Sat Aug 16 15:46:38 2014 +0400
https://github.com/PHPOffice/PHPWord/issues/216
commit d66e8559e6248eb26ea4942a244993731da9c5ce
Author: Progi1984 <progi1984@gmail.com>
Date: Sat Aug 16 13:28:27 2014 +0200
#23 : Implement Word97 aka MsDoc Reader (Documentation )
[franz@localhost PHPWord (develop)]$ git branch -a
* develop
master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/gh-pages
remotes/origin/master
remotes/origin/patch-1
remotes/origin/patch-2
remotes/upstream/develop
remotes/upstream/gh-pages
remotes/upstream/master
remotes/upstream/patch-1
remotes/upstream/patch-2
remotes/upstream/patch-3
[franz@localhost PHPWord (develop)]$ git remote add --track develop upstream https://github.com/PHPOffice/PHPWord.git
fatal: la distante upstream existe déjà.
[franz@localhost PHPWord (develop)]$ git remote -v
origin https://github.com/franzholz/PHPWord.git (fetch)
origin https://github.com/franzholz/PHPWord.git (push)
upstream https://github.com/franzholz/PHPWord.git (fetch)
upstream https://github.com/franzholz/PHPWord.git (push)
[franz@localhost PHPWord (develop)]$ git fetch upstream
[franz@localhost PHPWord (develop)]$ git merge upstream/develop
Already up-to-date.
现在我仍然没有当前分支中的最新版本的上游代码。
[franz@localhost PHPWord (develop)]$ git pull origin remotes/origin/develop
fatal: Couldn't find remote ref remotes/origin/develop
Unexpected end of command stream
[franz@localhost PHPWord (develop)]$ git pull origin origin/develop
fatal: Couldn't find remote ref origin/develop
Unexpected end of command stream
[franz@localhost PHPWord (develop)]$
[franz@localhost PHPWord (develop)]$ git pull origin/develop
fatal: 'origin/develop' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
答案 0 :(得分:0)
我找到了一个解释必要步骤的视频。忘记网络上的教程。Syncing Your GitHub Fork
我必须执行来自此视频的这些步骤
[franz@localhost PHPWord (develop)]$ git remote rm upstream
[franz@localhost PHPWord (develop)]$ git remote add upstream https://github.com/PHPOffice/PHPWord.git
[franz@localhost PHPWord (develop)]$ git remote -v
origin https://github.com/franzholz/PHPWord.git (fetch)
origin https://github.com/franzholz/PHPWord.git (push)
upstream https://github.com/PHPOffice/PHPWord.git (fetch)
upstream https://github.com/PHPOffice/PHPWord.git (push)
[franz@localhost PHPWord (develop)]$ git fetch upstream
remote: Counting objects: 6758, done.
remote: Compressing objects: 100% (1434/1434), done.
remote: Total 6758 (delta 6608), reused 5377 (delta 5313)
Receiving objects: 100% (6758/6758), 9.43 MiB | 2.35 MiB/s, done.
Resolving deltas: 100% (6608/6608), done.
From https://github.com/PHPOffice/PHPWord
* [new branch] develop -> upstream/develop
* [new branch] gh-pages -> upstream/gh-pages
* [new branch] master -> upstream/master
[franz@localhost PHPWord (develop)]$ git merge upstream/master
Fusion automatique de docs/elements.rst
CONFLIT (contenu) : Conflit de fusion dans docs/elements.rst
Automatic merge failed; fix conflicts and then commit the result.
[franz@localhost PHPWord (develop|MERGING)]$ git merge upstream/develop
error: 'merge' is not possible because you have unmerged files.
astuce: Corrigez-les dans la copie de travail,
astuce: et utilisez 'git add/rm <fichier>' si
astuce: nécessaire pour marquer la résolution et valider,
astuce: ou utilisez 'git commit -a'.
fatal: Exiting because of an unresolved conflict.
由于冲突,任务尚未完成。然而,这是另一个问题。至少从原始的repos到我的本地计算机的提取和合并似乎是有效的。修复冲突后,我将能够将本地分支推回到我的远程分支中。