From 955a6b7b5428b26899db274cd8d745933175364e Mon Sep 17 00:00:00 2001 From: Ein Verne Date: Thu, 16 Apr 2020 00:35:25 +0800 Subject: [PATCH] git-stage: add page (#3963) * git-stage: add page * Apply suggestions from code review Co-Authored-By: Starbeamrainbowlabs * Update git-add.md * Update git-stage.md Co-authored-by: Starbeamrainbowlabs --- pages/common/git-add.md | 4 ++++ pages/common/git-stage.md | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 pages/common/git-stage.md diff --git a/pages/common/git-add.md b/pages/common/git-add.md index c97059f89a..910d0c6a21 100644 --- a/pages/common/git-add.md +++ b/pages/common/git-add.md @@ -26,3 +26,7 @@ - Interactively stage parts of a given file: `git add -p {{path/to/file}}` + +- Interactively stage a file: + +`git add -i` diff --git a/pages/common/git-stage.md b/pages/common/git-stage.md new file mode 100644 index 0000000000..9f3e301861 --- /dev/null +++ b/pages/common/git-stage.md @@ -0,0 +1,33 @@ +# git stage + +> Add file contents to the staging area. +> Synonym of `git add`. +> More information: . + +- Add a file to the index: + +`git stage {{path/to/file}}` + +- Add all files (tracked and untracked): + +`git stage -A` + +- Only add already tracked files: + +`git stage -u` + +- Also add ignored files: + +`git stage -f` + +- Interactively stage parts of files: + +`git stage -p` + +- Interactively stage parts of a given file: + +`git stage -p {{path/to/file}}` + +- Interactively stage a file: + +`git stage -i`