Skip to content
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.

[2020-03-02]: [How to sync fastai/fastpages with forked FastPages] #163

Closed
2 tasks
byteshiva opened this issue Mar 2, 2020 · 4 comments
Closed
2 tasks
Labels
bug Something isn't working

Comments

@byteshiva
Copy link
Contributor

Required Prerequisites for filing a bug

You must check both boxes

  • Have you searched opened / closed issues on this repo for a similar problem?
  • Have you searched the fastai forums for a similar problem?

Required information

Failure to provide this information or going through these steps will result in automatic closing of the issue

I have forked a fastpages and build a blog. Now that I see some fixes committed on fastpages which I want to sync on my forked fastpages. I followed https://nearsoft.com/blog/how-to-synchronize-your-github-fork/,, but It throw me

git merge upstream/master 
fatal: refusing to merge unrelated histories

How do I resolve the unrelated histories on git.

@byteshiva byteshiva added the bug Something isn't working label Mar 2, 2020
@hamelsmu
Copy link
Member

hamelsmu commented Mar 2, 2020

Please try this: https://stackoverflow.com/questions/56577184/github-pull-changes-from-a-template-repository/56577320

Note that we are working on an automated system pending review #143 but please try the stack overflow approach in the meantime.

Closing this issue. If still encountering a problem please open a thread on the fastai forums under the nbdev & blogging topic: https://forums.fast.ai/

@hamelsmu hamelsmu closed this as completed Mar 2, 2020
@byteshiva
Copy link
Contributor Author

Thanks @hamelsmu

I'm adding the steps for future reference.
Step 1

$ git remote add template git@github.com:fastai/fastpages.git 
$ git remote -v 
origin	git@github.com:byteshiva/blog.git (fetch)
origin	git@github.com:byteshiva/blog.git (push)
template	git@github.com:fastai/fastpages.git (fetch)
template	git@github.com:fastai/fastpages.git (push)
upstream	git@github.com:fastai/fastpages.git (fetch)
upstream	git@github.com:fastai/fastpages.git (push)

Step 2:

$ git fetch --all 
Fetching origin
remote: Enumerating objects: 43, done.
remote: Counting objects: 100% (43/43), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 26 (delta 9), reused 24 (delta 7), pack-reused 0
Unpacking objects: 100% (26/26), done.
From github.com:byteshiva/blog
   d7e8201..b67202a  gh-pages   -> origin/gh-pages
Fetching upstream
remote: Enumerating objects: 86, done.
remote: Counting objects: 100% (86/86), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 86 (delta 38), reused 64 (delta 27), pack-reused 0
Unpacking objects: 100% (86/86), done.
From github.com:fastai/fastpages
   e8bf9f8..bcdbc22  gh-pages   -> upstream/gh-pages
   5b4b79e..8f5a7bc  master     -> upstream/master
Fetching template
From github.com:fastai/fastpages
 * [new branch]      change-docker      -> template/change-docker
 * [new branch]      gh-pages           -> template/gh-pages
 * [new branch]      master             -> template/master
 * [new branch]      pin-jekyll-version -> template/pin-jekyll-version
 * [new branch]      search-highlight   -> template/search-highlight

Step 3:

$ git merge template/master 
fatal: refusing to merge unrelated histories

**fatal: refusing to merge unrelated histories << to allow unrelated histories go to Step 4:

Step 4:

$ git merge template/master --allow-unrelated-histories
CONFLICT (add/add): Merge conflict in index.md
Auto-merging index.md
CONFLICT (add/add): Merge conflict in assets/main.scss
Auto-merging assets/main.scss
CONFLICT (add/add): Merge conflict in assets/js/search.js
Auto-merging assets/js/search.js
CONFLICT (add/add): Merge conflict in _posts/2020-01-14-test-markdown-post.md
Auto-merging _posts/2020-01-14-test-markdown-post.md
CONFLICT (add/add): Merge conflict in _notebooks/2020-02-20-test.ipynb
Auto-merging _notebooks/2020-02-20-test.ipynb
CONFLICT (add/add): Merge conflict in _includes/youtube.html
Auto-merging _includes/youtube.html
CONFLICT (add/add): Merge conflict in _includes/twitter.html
Auto-merging _includes/twitter.html
CONFLICT (add/add): Merge conflict in _includes/notebook_github_link.html
Auto-merging _includes/notebook_github_link.html
CONFLICT (add/add): Merge conflict in _includes/notebook_colab_link.html
Auto-merging _includes/notebook_colab_link.html
CONFLICT (add/add): Merge conflict in _includes/favicons.html
Auto-merging _includes/favicons.html
CONFLICT (add/add): Merge conflict in _config.yml
Auto-merging _config.yml
CONFLICT (add/add): Merge conflict in _action_files/settings.ini
Auto-merging _action_files/settings.ini
CONFLICT (add/add): Merge conflict in _action_files/nb2post.py
Auto-merging _action_files/nb2post.py
CONFLICT (add/add): Merge conflict in _action_files/action_entrypoint.sh
Auto-merging _action_files/action_entrypoint.sh
CONFLICT (add/add): Merge conflict in README.md
Auto-merging README.md
CONFLICT (add/add): Merge conflict in Makefile
Auto-merging Makefile
CONFLICT (add/add): Merge conflict in .github/workflows/setup.yaml
Auto-merging .github/workflows/setup.yaml
CONFLICT (add/add): Merge conflict in .github/workflows/ci.yaml
Auto-merging .github/workflows/ci.yaml
Automatic merge failed; fix conflicts and then commit the result.

Step 5:
How to list conflicted files in git.
refer : List conflicted files in git

git diff --name-only --diff-filter=U
.github/workflows/ci.yaml
.github/workflows/setup.yaml
Makefile
README.md
_action_files/action_entrypoint.sh
_action_files/nb2post.py
_action_files/settings.ini
_config.yml
_includes/favicons.html
_includes/notebook_colab_link.html
_includes/notebook_github_link.html
_includes/twitter.html
_includes/youtube.html
_notebooks/2020-02-20-test.ipynb
_posts/2020-01-14-test-markdown-post.md
assets/js/search.js
assets/main.scss
index.md

Step 6:
Resolve conflicts using Microsoft Vscode or any of your preferred IDE.
image

Step 7:
After resolving all merge conflicts

git add . 
git commit -m " commit message comes here "

@hamelsmu
Copy link
Member

hamelsmu commented Mar 3, 2020

Great writeup! Mind if I repost this on the forums for the benefit of others?

Thank you for taking the time to write it down 😃

@byteshiva
Copy link
Contributor Author

Great writeup! Mind if I repost this on the forums for the benefit of others?

Thank you for taking the time to write it down

Sure

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants