This first version of this post might be clunky to say the least.
Okay, my latest volunteer gig is with Mil-OSS. Specifically, I’m creating a website for the Central Florida chapter. One of the leaders created a GitHub repository and added me as a collaborator. Now I need to create a local repository and upload my shizzle.
I could be wrong, but I don’t think you can just git init in a folder of your files and upload them to a GitHub repo. This seems to be the process for uploading files you’ve created before creating (or being added to) a GitHub repo. It’s especially irritating if, for example, you’ve configured your Site/Server settings in Dreamweaver.
- Navigate to the folder in which you’ll clone the remote repo by typing cd and the path to the folder.
- Clone the remote repo locally by typing git clone and the SSH stuff on the repo page at GitHub.com.
- Move all the files you’ve created into the new folder that creates — your new local repository (via the command line or drag & drop).
- Navigate into that local repo via cd.
- Tell Git you want to add all these new files to your next commit by typing “git add .” (no, don’t include the quotes but, yes, include that period).
- Commit those files by typing git commit -m “<message>” where <message> (yes, this time include those quotes) is notes to yourself about the commit (what the latest changes are, for example). The -m tells Git that you’re including the message part.
- Push your files to the remote repo by typing git push <your SSH shizzle> master.
Much Easier Method!
Update May 16, 2016: Found this yesterday after making the mistake of thinking that cloning someone else’s project would automatically create a repo on GitHub (nope, that’s “forking” … I think). You simply create the new remote repo on GitHub and type the following into the terminal:
git remote add origin <URL>
git push -u origin master