Chapter 4 Save Your Work to GitHub
Time to save your website and put it on GitHub so you can deploy it to the internet.
4.1 Step 1: Create Repository on GitHub
- Click the green “New” button on GitHub
- Repository name:
my-academic-website(or whatever you prefer) - Make it Public (required for free Netlify hosting)
- Don’t check “Add a README” (you already have one)
- Click “Create repository”
4.2 Step 2: Connect Your Local Site to GitHub
Copy the commands GitHub shows you, but here’s what you’ll run:
# Make sure you're in your website directory
cd ~/websites/my-academic-site
# Add your changes
git add .
git commit -m "My academic website setup"
# Set branch to main (important!)
git branch -M main
# Connect to your GitHub repository
git remote add origin https://github.com/YOUR-USERNAME/my-academic-website.git
# Push to GitHub
git push -u origin mainReplace YOUR-USERNAME with your actual GitHub username.
4.3 Step 3: Basic Git Workflow
Now you have a simple workflow for updating your website:
# After making changes to your site:
# 1. Save all changes
git add .
# 2. Commit with a message
git commit -m "Updated my bio and added new publication"
# 3. Push to GitHub
git pushThat’s it! Three commands to save and sync your website.
4.5 When Things Go Wrong
Can’t push? Try:
Made a mistake? Don’t worry:
- GitHub keeps all your old versions
- You can always go back
- Your local files are safe
4.6 Why GitHub?
For your website:
- Free hosting for your code
- Version history - see all your changes
- Backup - your site is safe in the cloud
- Required for Netlify deployment
For your research:
- Share code and data
- Collaborate with others
- Professional presence
- Industry standard
4.7 Check Your Work
Your website code should now be visible at:
https://github.com/YOUR-USERNAME/my-academic-website
You should see all your files there, including:
content/folder with your profileconfig/folder with settings- All the template files
4.8 Next Step
Perfect! Your website is now saved on GitHub.
In the next chapter, we’ll deploy it to the internet so anyone can visit your professional academic website.
💡 Pro Tip: Use descriptive commit messages like “Added new paper” or “Updated bio” - you’ll thank yourself later!
🔒 Remember: Your repository is public, so don’t commit sensitive information like personal documents or passwords.