diff --git a/README.md b/README.md index 0d73863..37ab531 100644 --- a/README.md +++ b/README.md @@ -122,24 +122,27 @@ Check the logs Configure user information for all local repositories -`$ git config --global user.name "[name]"` - +```shell +$ git config --global user.name "[name]" +``` Sets the name you want attached to your commit transactions -`$ git config --global user.email "[email address]"` - +```shell +$ git config --global user.email "[email address]" +``` Sets the email you want attached to your commit transactions -`$ git config --global color.ui auto` - -Enables helpful colorization of command line output ```shell +$ git config --global color.ui auto +``` +Enables helpful colorization of command line output If you want to save your https credentials run ```shell git config --global credential.helper store Omit --global to set the identity only in this repository. ``` + Or you can add an [SSH key](https://help.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account) ### Terminal commands @@ -172,23 +175,30 @@ Any commits you make will be made on the branch you’re currently “checked ou Use git status to see which branch that is. Creates a new branch -`$ git branch [branch-name] -git checkout -b -` +```shell +$ git branch [branch-name] +$ git checkout -b [branch-name] +``` Switches to the specified branch and updates the working directory -`$ git checkout [branch-name]` +```shell +$ git checkout [branch-name] +``` Combines the specified branch’s history into the current branch. This is usually done in pull requests, but is an important Git operation. -` $ git merge [branch] ` +```shell +$ git merge [branch] +``` Deletes the specified branch -` $ git branch -d [branch-name] ` +```shell +$ git branch -d [branch-name] +``` -Seeing available branches +Show all available branches ```shell git branch -a ``` @@ -203,6 +213,7 @@ Delete remote branch git push --delete git remote prune ``` + Check the log in graph form ```shell git log --graph --oneline