Create a GitHub Repo and Back up your Project

First, open up your terminal and move into the root of your project. For example, if your project is in a folder called ‘delicious’ on your Desktop, you would run the following in your terminal:

cd~/Desktop/delicious

Once you are there, place your project under version control:

git init

Then add and commit all of your files:

git add -A
git commit -m "initial commit"

Great! Now your project is ready. Next, you’ll make a home for it on GitHub.

Log on to GitHub and create a new repository.

Give your new repository a name, preferably something that makes it easy to see which project this repository is linked to. Add a description if you like, leave “Public” checked, and click Create repository.

The next page will give you a few options as to how you would like to get your files up on your shiny new GitHub repository. Given that we have already set everything up in the terminal, we will choose the second option to “push an existing repository from the command line.”

Copy/paste the commands you see beneath the option and run them each in the terminal or GitBash, one at a time.

Refresh your page, and… snapadoodle! Your files are all there!!

You now have a backup of your project! And you can share this link with whomever you like (as long as your repository is set to Public) and even collaborate with other developers if you want to.

Throughout the lifetime of your project, remember to keep adding and committing your files as you work on them, and to push up your changes regularly. That’s it! Your code has been “Gitified” just like a pro. Time to celebrate!

Still need help? Contact Us Contact Us