better code blocks

This commit is contained in:
Bastian 2020-01-13 10:08:50 +01:00
parent 2537523d7d
commit 830bc551c4

View File

@ -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 youre currently “checked ou
Use git status to see which branch that is.
Creates a new branch
`$ git branch [branch-name]
git checkout -b <branchname>
`
```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 branchs 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 <remote_name> --delete <branch_name>
git remote prune <remote_name>
```
Check the log in graph form
```shell
git log --graph --oneline