Simplistic Git Tutorial
Generally speaking ... we're looking at two separate things here, using git locally and with a service such as GitHub or Bitbucket. Using locally:
initialize the directory, add the items, commit
git add -A OR git add .
#above is all to add all items. You can add specific items too
git add file1 file2 file3
git commit -m 'm is for message, add your message here'
git status #check current status
First things first, create you ssh key
Copy the public key and use that for your key in GitHub/Bitbucket
Connecting with a remote server. Pretty much the same as above, of course we need to specify our remote location
git remote add origin firstname.lastname@example.org:gituser/reponame.git
git push origin master
When we push origin master, we push up to our remote GitHub account.
When you are happy with you current state, you can create a branch, and work off the branch.
Move to the new branch
Create and move to all in one
Now you can do all your work on the branch, when you're happy, commit and merge it with master
git checkout master
# check the current working branch
You can either keep the branch or delete
For cloning a repo
# track it
git remote add upstream git://github.com/gituser/reponame.git
git fetch upstream
# I generally do
To help keep my clones organized I create a git directory
git clone .....
be happy and organized
Other cool stuff
git log --graph
More disclaimer, again, I am not a pro at this, its mainly from what I've picked up from personal use. There is obviously so much more that can be done, and possibly better ways to do stuff. For my configs and such I generally don't branch, but when I was coding, I would definitely branch.
Hopefully I didn't leave anything important out.
Edit: IIRC when you add a remote origin,if its added as https, not ssh. You can change that with set-url