18 lines
487 B
Markdown
18 lines
487 B
Markdown
---
|
|
title: "better git add"
|
|
date: 2020-01-11T05:07:50+01:00
|
|
draft: false
|
|
snippet_types: ["git"]
|
|
---
|
|
|
|
```shell
|
|
$ git add -p
|
|
```
|
|
|
|
I tend to use magit in emacs to stange and unstage files/hunks but in a pinch **-p** or **git add -i** +
|
|
selecting patch works great. You can choose exactly which hunks you want to stage leading to cleaner
|
|
incrimental commits. The bonus to using magit is you can easily edit the file during the process.
|
|
|
|
source:
|
|
|
|
[git docs](https://git-scm.com/docs/git-add)
|