Local Jekyll version on new computer and re-establishing GitHub link

I wonder if anyone can help. I have a local version of a Jekyll blog on my computer and I then push any changes to GitHub where the site is hosted. I am getting a different computer and I am wondering how I can transfer my local version on to the new computer and then re-establish the link with GitHub. My idea at the moment is:

  • Create a copy of my local Jekyll site from my old computer
  • On the new computer install Jekyll and create a new blog. Delete the contents/files from this new site and then replace with the contents of my Jekyll site from my old computer

At this point I am a little unsure on the GitHub commands to re-establish the link between my local Jekyll version and the GitHub repository. I am bit concerned that there could be conflicts. Any suggestions on what the git commands would be or if there is a better way to do this would be much appreciated.

Not sure it makes any difference but I am using Linux.

Hi hajhub,

Appologies if I am misunderstanding the issue, but it sounds to me like you want to git pull your repo to the new computer. That would copy the files from GitHub to a local device exactly as they were last push ed.

If by ā€˜re-establish the link with my GitHubā€™ you mean ā€˜add new SSH keys for my new computer,ā€™ documentation can be found here.

If you do run into conflicts, there are git commands to fix them, as well as to revert changes. Documentation for that can be found here.

Hope that helps.

you can clone it if you just want to add it to another computer, go to your repo on GH and there should be a green button at the top with a download icon, click it and then copy the command you want (SSH or HTTPS) and then paste that into the terminal on your new computer and then it should create a folder with the name of the repo and it will have everything in it that you need. It should also allow you to git push any changes without any issues.

Hi, thank you very much. Yes it does help. Itā€™s just the first time Iā€™ve had to do this so a little uncertain about the processā€¦ git pull makes a lot of sense as does the link to sorting out conflicts.

Thank you very much for that information. Planning on working through this later in the week.

You just need to make sure the GitHub repo is up to date before cloning . .

If you just want to bring everything from the old computer to the new computer, you should be fine just copying the local repo folder from old to new.

If you want to be really sure everything copies over from the old computer to the new computer, display all hidden files/folders and then copy, so you can verify any hidden git files/folders did copy.

After you install Ruby and Jekyll on your new computer, I think you might need to go to the local repo folder you copied over and run a bundle install and bundle update. The connection to the remote GH repo should remain. You should not have to build a new site or pull/clone from GH.

As you and others mention, it would be a good idea to push all your commits and branches up to GH first, assuming that does not break your site.

I might be missing something and Iā€™m not a Git expert, so apologies if Iā€™m missing something, but I think these steps are correct.

There has been some good advice given and Iā€™ve been considering what to do overnight. What you say about ensuring that all the hidden files from my original local copy across is what I was really worried about. When using GitHub to host a Jekyll site produced locally, I was uncertain whether all the local files (e.g. hidden) are pushed to Jekyll. With a new computer, if I then pull the site from GitHub will some of those essential files be missing?

I agree with you in your third paragraph that I would need to ā€œrun a bundle install and bundle updateā€.

Iā€™ve been trying to search for the correct procedure but at the moment Iā€™m thinking that I might try copying the original folders across and then running git push origin 'branch_name' .

You might be over thinking it. If you are doing all your development on your local repo first, just copy the folder from the old computer to the new one. Use my approach of copying hidden files and folders.

Once thatā€™s done, you are done. The link is maintained because itā€™s in the git file(s?) inside that folder you already copied. Just keep going developing as you always have.

1 Like

After bundle install and bundle update :slight_smile:

1 Like