Simple git command cheat sheet for the everday beginner who is likely their only contributor and doesn't need to get too deep.
Two methods here, initializing local folders as a repository and then creating the remote repository online, or cloning an existing repository online to your local directories.
Initializes the local directory as a local repository.
Then create a new repo online: https://github.com/new
$ git remote add origin https://github.com/YourAccount/RepoYouMade.git
This tells your local git repo that the name "origin" will be this specific url.
Creates a local clone of whatever remote repository is at the URL.
See if any files have been changed but not staged to be committed.
Adds all files to the staging area. Replace "." with the filename to add only a specific file.
Commit to updating the staged files on the repository, always leave a note with -m.
Check the status again to verify only the staged files were committed and everything is as planned.
Pushes the changes to origin and the branch named master so that others can see it and work on it as well.
Shows what is staged to be committed with git add and committed to the changes with git commit. Do this before add/commit and after to verify your sanity.
List of commits in chronological order with their long jumbly names.
If any changes were made on the remote master branch, this will integrate all the changes with your local repository. This also makes sure you start the day with a clean copy of whatever it is you happen to be doing.
If working with other people, this will tell you if any changes have been made but will not integrate them immediately.
yoloswag all those changes into your copy.
Creates a new branch, which is a good idea to do all the damn time whenever you try something diff, add new stuff, whatevers. Even bug fixing. Create a new branch.
Switches you to that other branch so you are no longer working directly on the safe and functional master branch, for example. All commits and changes are recorded on the checked out branch and kept separate so you can play around as much as you want.
Switches back to the master branch so that you can...
This will merge all the cool new additions you've made under newbranch into the master branch