gitHub made simple Clark Wilkins, Simplexable 2019.05.05
I have to admit that, despite being a registered github.com user for years, I have never actually used version control until today. Their site has a great bug tracker, but also considerably more. In any case, here's a simple run-down on how to take your existing project and get it loaded into gitHub.
First, get an account and register a repository. All it needs for now is your project name. We're going to load it up shortly.
Now go your development directory on your computer and create an empty sub-directory. This is a step that cannot be skipped — git will not set up in the directory if it's not empty.
Now we "clone" the gitHub repository down to our new directory. Since the repository is empty, we are just creating a setup.
# cd /Library/Webserver (my main directory where i keep projects)
# sudo git clone git@github.com:abc/def.git (downloads a local copy)
Now we have a directory /Library/Webserver/abc that's ready to accept your project. Move a copy of your project into abc. Then we add the files to the gitHub local repository and sync them to the repository on github.com
# cd /Library/Webserver/abc (the new directory)
# sudo git add -A (adds all files to the list to be "committed")
# sudo git commit -m "Committing my stuff to the repository" (prepares it for sync to server) # sudo git push (pushes it up to the server)
Essentially, it's six steps plus moving your project files in after step two. That's it.