git/GitHub Notes

I found looking at the directions written out like this helpful.
If anyone sees something I missed let me know and I will add/correct the Notes.

####################### git starting local #######################

$ git init [folder]==> inside the file to save/commit ==>one time to set up a look into the folder
$ git status ==> see it is a untracked file ==> do after EVERY step
$ git add [file]==> example: $ git add index.html
$ git status ==> check status of file new file On branch master
$ git commit -m “Created index.htm file”==> gives a commit and a note to tell what was committed
$ git status ==> nothing to commit, working directory clean

##################### git while working local (add, commit) #####################

$ git status ==> modified
$ git add [file] ==>example: $ git add index.html
$ git status ==> or go to commit
$ git commit -m “Created index.htm file”==> commit/save and give a comment for each change

######################### git to GitHub (push) ########################
Create a new repository in GitHub with the folder name
$ git remote add origin [URL from the newly created GitHub repository]==>setup connection local-GitHub
$ git push origin master ==> send all local changes to GitHub remote repo(origin/master branch)

4 Likes

It’s a nice sheet, and helpful. Thanks!

Just to note to others-- where she uses, say, “index.html”, this is serving as an example of what the code can do. The commands are not specific to, or limited to, this exact file.

You are welcome!
Thanks! I added the word example: to those sections of the description.

That’s cool, thanks.