Newbie needs help: How to move hugo from Mac to Ubuntu

Hi folks, I am a 2-month old Hugo user. I built my site from Mac OS. However, unfortunately, my Mac experienced a problem and then sent to Genius Bar repair. During waiting for repair, I am now learning how to move Hugo from Mac OS to Linux Ubuntu.

What I have done are:
First: Created a local folder ‘hugo’ by using ‘hugo new site hugo’
Second: Used ‘git clone My-Site-URL’
Third: Used ‘git submodule init’ and ‘git submodule update’

For further actions, I found that there is no ‘public’ folder, therefore I cannot use ‘cd public’, ‘git checkout master’, and more.

Could any geek help me to access Hugo from different devices? I cannot find any newbie-friendly tutorials.

ps, I used keywords or sentences like Hugo from multiple computers, from different computers, how to Hugo from Mac to Ubuntu…etc. Anyone could help to accurately describe my question, thanks!

Kind Regards
Elliot

So your site is in a cloud git repository? All you should have to do is close the site from git and initialising the submodules should do the trick (you shouldn’t need to run hugo new site before hand). And then you just push the changes back into git and pull them on each machine you use.

Is public in your git repository? If it’s not, it will be created by running hugo.

Thank you, @funkydan2, my site is in a git cloud repo. Because my Mac experienced a problem suddenly, during that time I didn’t back up data from local disk storage. All site related contents only use ‘Clone by HTTPS’ from online Github, but they didn’t have the ‘public’ storage. I just cloned ‘public’ folder from the cloud to the current Ubuntu disk successfully. All things done, but I cannot still re-edit my current markdown posts.

'Error: Unable to locate config file or config directory. Perhaps you need to create a new site.
Run hugo help new for details.

Just checking. You’ve clicked the Solution button. Is your problem solved? (Your previous post sounds like you’re still stuck.)

Thanks for reminding me. 1st time to use gohugo, selected ‘Solution’ incorrectly. I will try again, follow your previous post.

Could you link to your git repository? That will help with providing a solution.

Hi, my repo’s URL is GitHub - Elliottsao/Elliottsao.github.io

I just created witihn few months and didn’t write posts too many.

I may find the reason, after careful checking, I didn’t find the ‘theme’ folder on the local disk. A bit confuse, why didn’t Github clone theme folder together? Thanks.

1 Like

Yes - it looks like you’ve only cloned your public folder (which is what GitHub pages need). What you should have tracked in git was the whole hugo repository - with the theme, markdown files, and public.

If you don’t have a backup from your mac, you’ll have to recreate everything again via hugo new (at least you can get your content from your published site).

Thank you again. I will solve it later today.