From 6a7f0b8029183b01ce8406f53090e30231382ea7 Mon Sep 17 00:00:00 2001 From: Stan Le <54789831+stanle-cs@users.noreply.github.com> Date: Mon, 3 Jan 2022 00:46:10 -0500 Subject: [PATCH] I couldn't find a text-based tutorial on how to use fugitive on Github so I decided to start one :(. I'm a beginner so can only show the absolute noobs what to do. Please, everyone is welcome to edit this. --- Basic-fugitive-commands.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Basic-fugitive-commands.md diff --git a/Basic-fugitive-commands.md b/Basic-fugitive-commands.md new file mode 100644 index 0000000..7a65dbe --- /dev/null +++ b/Basic-fugitive-commands.md @@ -0,0 +1,11 @@ +`:G` or `:Git`: start the interactive prompt. You can then move around using vim's movement. Once in this screen, press `g?` to get a help screen that explains all the commands available. + +`Untracked`: not tracked by git. +`Unstaged`: tracked files that have changes in them. Needs to be staged before a commit. +`Staged`: staged file ready to be committed. +To stage a file: move the cursor to the line of that file and press `s` to add it to the `Staged` list. +To unstage a file: move the cursor to a staged file and press `u` to remove it from the `Staged` list and add it to the `Unstaged` list. + +Then, to commit the changes, press `cc`. You will then be asked to provide a commit message. Once done you can just `:wq` it and the commit will be done. + +Once you're ready to push your commit, push the commit using `:Git push`.