From 870d11cf264670bbff45d76589269dc11e73803b Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Mon, 19 Apr 2021 12:31:26 +0100 Subject: [PATCH] Add `git add -p` tip --- Git-Tips.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Git-Tips.md b/Git-Tips.md index 25c5d3b..ad991d4 100644 --- a/Git-Tips.md +++ b/Git-Tips.md @@ -37,6 +37,8 @@ More information is available in the [Contributing guidelines][contributing]. - changes can be reverted (`git restore `) 1. Stage the file(s) (`git add `) - staged files can be un-staged (`git restore --staged `) + - if you have multiple changes in a file, but only want to stage some of them in this commit, + use `git add -p` to mark which chunks you want to stage. 1. Commit the staged files (`git commit -m ""`) - leave off the second double-quotes to write a multi-line commit message - be careful using certain punctuation when doing this (e.g. backticks)