So I always thought it was pretty intimidating working with github. I figured I would need to learn a whole bunch of commands and spend many frustrating hours having to figure out what I am doing wrong. I came up on this codecademy video on youtube that was less than 6 minutes that helped me break through that. Here is what I learned.
First you will want to make sure that you create a repository for your project and name it how ever you would like. Then you will want to get into CLI and navigate to somewhere where you would like to download your project or repo to. The command you will want to use to download your repo will into said directory will begit clone https://www.github.com/youruser/nameofyourrepo
Once you have gone ahead and got your repo you will want to use git init
to initialize that directory so we can eventually push what is in that directory up to github.
Go ahead and make some changes. In my case I have a github.io website setup with a single index that I make updates to here. Once you are satisfied with your changes you will want to add all of the changes made so github knows what to send up to be eventually commited. the code for this will be git add .
the dot or period is indicating the whole directory, so whatever changes are made in the entire directory will be commited to your repo.
Next I always use git status
to check what files will be committed and what changes were made. This helps me to understand if I have made the correct code changes or if something should not be commited to the repo.
Now comes the fun part, we will now comment on our code then commit it. To comment on our repo changes you will use git commit -m "your comment here"
After this then you can push your changes up by typing git push -u master origin
You will likely be prompted to enter your username and password and that is about it.