blog/content/chs-git.md

20 lines
448 B
Markdown
Raw Normal View History

2019-04-22 11:35:20 +00:00
---
2019-04-22 13:44:16 +00:00
Title: Some git tricks
Date: 2019-04-22 17:00
Author: Fabrice
Category: cheat sheets
2019-04-22 15:15:19 +00:00
Slug: git-tricks
2019-04-22 13:44:16 +00:00
Header_Cover: images/cover_water.jpg
2019-04-22 11:35:20 +00:00
---
2019-04-22 15:15:19 +00:00
Some [git](https://git-scm.com/) tricks I use from time to time and that I forgot everytime…
2019-04-22 11:35:20 +00:00
Reset `master` to `origin/master`:
```sh
git co origin/master -B master
```
Another useful trick is `git commit -v`, it allows reviewing your changes before committing.
![Example](/examples/git-cv.svg)