-1

I want to checkout the https://github.com/PHPOffice/PHPWord Developer branch. However I only see outdated files on my local machine and do not get the recently modified files from the server. The pull request on the file "CONTRIBUTING.md" has been merged: https://github.com/PHPOffice/PHPWord/commit/48322ca89c09ad2bb2f5f6bb1fc60b872bde8c16 But I cannot fetch this version of the file to my local machine.

I have tried almost everything with 'git pull' and '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.

I have read and did follow several Git tutorials and also this issue about Git: How to clone all remote branches in Git?

If I open the website:

https://github.com/PHPOffice/PHPWord/blob/develop/CONTRIBUTING.md

Then I see the text "Every contribution is welcome; " in the first line.

On my local machine I execute.

[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.

Here is always the outdated and not fixed text: "Every contributions are welcomed".

My fork on Github is outdated, too. https://github.com/franzholz/PHPWord/blob/develop/CONTRIBUTING.md How can I update this fork on the server side?

Github Help "Syncing a fork":

[franz@localhost PHPWord (develop)]$ git merge upstream/develop 
Already up-to-date.

I am stuck here. I wanted to see the really fixed file as it is on the Git online repository of the develop branch. I am quite sure that my local develop branch is already connected to the remote develop branch. But how can I use my filesystem to see the real new file named "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.

Now I still do not have an up-to-date version of the upstream code in my current branch.

[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.
Community
  • 1
  • 1
Franz Holzinger
  • 835
  • 8
  • 16

1 Answers1

0

I have found a video which explains the necessary steps. Forget the tutorials on the web.Syncing Your GitHub Fork

I have to execute these steps which come from this video

[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.

The task is not finished due to conflicts. However this is another issue. At least the fetching and merging from the original repos into my local computer seems to work. After fixing the conflicts I will be able to push the local branch back into my remote fork.

Franz Holzinger
  • 835
  • 8
  • 16