|
8 | 8 | # GitGud
|
9 | 9 |
|
10 | 10 | ## **Introduction**
|
11 |
| - GitGud allows you to easily visualize and fully utilize git throughout your projects. It is created using [Ink](https://github.com/vadimdemedes/ink) which provides same component-based UI building experience that React offers, but in CLI (Command Line Interface). |
12 |
| - |
13 |
| - |
| 11 | + |
| 12 | + GitGud allows you to easily visualize and fully utilize git throughout your projects. It is created using [Ink](https://github.com/vadimdemedes/ink) which provides the same component-based UI building experience that React offers, but in a Command Line Interface (CLI). |
| 13 | + |
| 14 | + |
14 | 15 | ## **Requirements**
|
15 | 16 | - Have at least **git version 2.24.3** installed
|
16 | 17 | - Have [npm](https://www.npmjs.com/get-npm) installed
|
17 | 18 |
|
| 19 | +--- |
18 | 20 |
|
19 | 21 | ## **Installation**
|
20 | 22 | ```
|
21 | 23 | $ npm install --global gitgud
|
22 | 24 | ```
|
| 25 | + |
| 26 | +--- |
| 27 | + |
23 | 28 | This will install the package globally
|
24 | 29 | ## **Usage**
|
25 | 30 | ```
|
26 | 31 | $ GitGud
|
27 | 32 | ```
|
28 | 33 | - Navigate to any project that has a git directory in it and run the 'gitgud' command. This will load the gitgud UI to your terminal window
|
29 |
| -- GitGud UI consists view of: Unstaged Changes, Staged Changes, Git Branch tree view and functionality buttons |
| 34 | + |
| 35 | +- The GitGud UI consists of: Unstaged Changes, Staged Changes, Git Branch tree view and functionality buttons |
30 | 36 | - Navigate through the UI with either the 'tab' button or left/right arrow keys
|
31 | 37 | - Press 'enter/return' button to select/click an option
|
32 |
| -- Throughout the app you can hit 'esc'(escape) button to go back |
| 38 | +- Throughout the app you can hit the 'esc'(escape) button to go back |
| 39 | + |
| 40 | +--- |
33 | 41 | ## **Functionality**
|
34 | 42 | * ### **Stage Changes**
|
35 |
| --- You can select 'STAGE/UNSTAGE (all files)' to move all the files between Stage Changes and Unstage Changes. |
36 |
| --- If you once which will move all files from 'Unstaged Changes' section of UI to 'Stage Changes'. If you click it again it will undo the 'Staged Changes' and move files back to 'Unstaged Changes' and so on. |
37 |
| --- You also have an option to stage/unstage individual files at your desire. |
38 |
| --- Press 'ESC' to exit out of stage changes |
| 43 | + - You can select `STAGE/UNSTAGE (all files)` to move all the files between Stage Changes and Unstage Changes. |
| 44 | + - If you click it once it will move all files from 'Unstaged Changes' section of UI to 'Stage Changes'. If you click it again it will undo the 'Staged Changes' and move files back to 'Unstaged Changes' and so on. |
| 45 | + - You also have the option to stage/unstage individual files by navigating through them with the up/down keys. |
| 46 | + - Press 'ESC' to exit out of stage changes menu. |
39 | 47 | * ### **Commit Changes**
|
40 |
| --- It will promt you to enter a 'Commit Message' which **does not require** you to wrap input in quotation marks. After entering and submitting the commit message it will bring you back to main menu and add the latest commit with its message to 'Git Branch' tree on the top of it |
41 |
| --- Press 'ESC' to exit out of commit changes |
| 48 | + - It will promt you to enter a 'Commit Message' which **does not require** you to wrap input in quotation marks. After entering and submitting the commit message, it run the commit and bring you back to the main menu. |
| 49 | + - Press 'ESC' to exit out of commit changes. |
42 | 50 | * ### **Push Staged Changes**
|
43 |
| --- This will push staged changes to the branch you are on |
| 51 | + - This will push staged changes to the current branch you are on. |
| 52 | + - You can see what branch you are on on the top of the GUI. |
44 | 53 | * ### **Checkout Branch**
|
45 |
| --- It will display list of branches which are not selectable, they are there to help you see which local branches are available. |
46 |
| --- It will promt you to enter 'Checkout branch' and if it does not exist on local it will create a new one and if it exists then it will checkout to the existing one. |
47 |
| --- If you have unstaged changes the error will be shown and will abort operation and tell you that you have unstaged changes and to commit the changes or stash before switching branches. You can press 'ESC' to go back and stash/commit the changes before you attempt to checkout again |
| 54 | + - It will display list of all the branches in the project. The branches are not selectible, they are there to help you see which local branches are available to switch to. |
| 55 | + - You are prompted to enter a branch to Checkout. If you enter a branch that does not exist, it will create a new one. |
| 56 | + - If you have unstaged changes, an error will be shown and it will abort the checkout operation, telling you that you have unstaged changes and to commit or stash the changes before switching branches. You can press 'ESC' to go back and stash/commit the changes before you attempt to checkout again |
48 | 57 | * ### **Delete Branch**
|
49 |
| --- It will display list of branches which are not selectable, they are there to help you see which local branches are available. |
50 |
| --- It will promt you to enter 'Delete Branch' and if the branch exists it will delete/remove it and bring you back to main menu, if the branch does not exist then it will throw an error. |
51 |
| --- Press 'ESC' to exit out of delete branch |
| 58 | + - It will display list of branches which are not selectable, they are there to help you see which local branches are available. |
| 59 | + - You are promted to enter a branch name, and if the branch exists it will delete/remove it and bring you back to main menu. If the branch does not exist then it will throw an error. |
| 60 | + - Press 'ESC' to exit out of delete branch |
52 | 61 | * ### **Access Full Log Tree**
|
53 |
| --- It will render whole full log tree which is scrollable which shows the tree and commit messages where the * is on the tree |
54 |
| --- Press 'ESC' to exit out of log tree |
| 62 | + - It will render the entire log tree overlaying the gitgud GUI. |
| 63 | + - Press 'ESC' to exit out of log tree |
55 | 64 | ### **FAQ**
|
56 | 65 | ### **Contributing**
|
57 |
| --- GitGud is a fully open source project and contributions are welcome! |
58 |
| --- When submitting a pull request, please clearly explain the feature you added or the bug you fixed. |
| 66 | +GitGud is a fully open source project and contributions are welcome! |
| 67 | + |
| 68 | +When submitting a pull request, please clearly explain the feature you added or the bug you fixed. |
59 | 69 |
|
60 | 70 |
|
61 | 71 | Thanks to [`Joseph Garrone`](https://github.com/JosephGarrone) for giving us the NPM package name.
|
0 commit comments