I would love to be able to sync my project files with a new Github account/repository I have setup.
I’m using Atom but have drawn a blank with their integration.
Git is installed via > brew install git
My intention is to not host the pages with Github, just the project files.
I’m sorry I can’t follow the instructions given here: https://gohugo.io/hosting-and-deployment/hosting-on-github/
- First you need to create a repo on GitHub.
- Then you copy its
https
address (this is simpler than SSH)
Since you seem to be on macOS
- First open the Terminal app and leave it open
- Then navigate to the folder containing the directory of your Hugo project.
- Drag the folder of the Hugo project to the Terminal icon on the dock so that a new Terminal window opens with the PATH to your Hugo project.
In the new Terminal window do the following:
- Execute
git init
to initialize git. - Then run
git remote add <paste the https URL you copied earlier from GitHub>
Now you have setup the GitHub repo as the remote origin of your local Hugo project.
To create the initial commit type:
git add .
git commit -m "Initial commit" && git push -u origin master
That’s pretty much how one would initialize git in a Hugo project.
There are plenty of tutorials about git on the web.
If you feel that the terminal is too much work then try one of the various Git clients like Sourcetree etc.
My favorite git client is Fork
1 Like
Wonderful! Thanks so much for your help. The initial commit process prompts for a username and password in Terminal but otherwise these instructions are complete. Thanks again.