git config --global --get user.email
retrieves the user's global e-mail, remove global keyword for local retrieval.
git config --global --get user.name
retrieves the user's global username, remove global keyword for local retrieval.
Change to the second accounts enough before doing anything and then things fall into place with GCM.
git config user.name "Your Second Account Name"
git config user.email "[email protected]"
git rm -r directory
deletes the specified directory.
git rm -r file.ext
deletes the specified file.
git branch
shows all the branches.
git add -p
cycles through all the changes and asks you which "hunk" of code you would want to make a commit for. Use s
to keep breaking up the chunks, use q
to quit because staging all the chunks doesn't mean you get to commit them one by one, and n
to skip the chunk.
git checkout -b 'branchname'
creates a new branch and takes you to it: there's a branch naming convention where branch names can include letters, numbers, dashes ( - ), underscores ( _ ), and dots ( . ), but they cannot begin with a dot or end with a slash ( / ). Git is case-sensitive, so Feature
and feature
are considered different branches.
git push -u origin your_branch
sends the branch over to be cemented into the repository.
git clone repo_url
clones a github repository including the history of the repo, downloading from github doesn't include the history.
git shortlog
shows a short list of all the logs concerning users that have made changes to the repo:
it only displays the first line of the commit.
The subject of the body has to be seperated from the body with a blank line.
My subject line
Body text here.
If the subject isn't equal to 50 characters, the rest of the text gets truncated.
Unsure what the reasoning is for this.
There cannot be any periods ending the subject line because it wastes precious space.
The command tone should be used in the subject line i.e. clean your room, close the door, and take out the trash. One tip for accomplishing this easily is to be able to complete the following sentence: If applied, this commit will your subject line here.
The description should start a new line every 72nd character.