From 81c14b0f4199f951ee623c3ae03ba7bb3697b621 Mon Sep 17 00:00:00 2001 From: Blank_Alt <12406-Blank_Alt@users.noreply.gitgud.io> Date: Tue, 7 Sep 2021 00:50:40 +0000 Subject: [PATCH] Clarify documtation --- CONTRIBUTING.md | 8 ++++++- devNotes/gitSetup.md | 56 ++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 413112e667a..ff968cd5905 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,10 +19,16 @@ To effectively work on the project the following tools are required: ### Setting everything up 0. Clone the project from GitGud.io ([Detailed Git setup and work cycle](devNotes/gitSetup.md)) -1. Open a terminal (Linux) / cmd window (Windows) and navigate to the `fc-pregmod` root directory. +1. Open a terminal (GNU/Linux) / cmd/Powershell window (Windows) and then navigate to the `fc-pregmod` + root directory via `cd PATH`. e.g. + Windows: `cd C:\path\to\project\fc-pregmod` + GNU/Linux: `cd /path/to/project/fc-pregmod/` + 2. Run `npm install` 3. Open the directory in your preferred IDE 4. Configure your IDE to use ESLint and the type checking capabilities of the TypeScript compiler. +5. It might also be worth installing the following extensions if using VS Code: + [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) and [GitLens — Git supercharged](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens). ## Compiling diff --git a/devNotes/gitSetup.md b/devNotes/gitSetup.md index 022c3049b5e..43094052397 100644 --- a/devNotes/gitSetup.md +++ b/devNotes/gitSetup.md @@ -2,58 +2,52 @@ ## First time setup -1. [Install Git for terminal](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) or a Git GUI of your +0. [Install Git for terminal](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) or a Git GUI of your choice. -2. Create an account on gitgud if you don't have a usable one. +1. Create an account on gitgud if you don't have a usable one. * (optional) Add an SSH key to your account for easier pushing. This allows you to connect to gitgud through SHH, which doesn't require your credentials every time. -5. Fork the main repository through gitgud interface. +2. Fork the main repository through gitgud interface. * (optional) Delete all branches other than pregmod-master, so you don't get them locally when fetching. -3. Clone the repo - * Via terminal: `git clone --single-branch https://gitgud.io/pregmodfan/fc-pregmod.git` +3. Clone the repo and then change to the new directory + * Clicking on the dropdown arrow on the far right blue clone button in the gitgud interface on your fork gives you the relevant URLs. + * Via terminal: `git clone --depth --single-branch 1 <url-to-your-fork> && cd fc-pregmod` -4. Get updates - * Via terminal: `git pull` - -6. Setup your fork as a remote - * Rename the main repository to upstream - * Via terminal: `git remote rename origin upstream` - * Add your repo as remote - * Via terminal: `git remote add origin <url-to-your-fork>` - * The big clone button in the gitgud interface on your fork gives you the relevant URLs. - -7. Checkout `pregmod-master` - * Via terminal: `git checkout pregmod-master` - -8. Make sure `fc-pregmod` tracks `upstream/pregmod-master` - * Via terminal: `git branch -u upstream/pregmod-master` +4. Add the main repository as a remote target + * Via terminal: `git remote add upstream https://gitgud.io/pregmodfan/fc-pregmod.git` ## Typical cycle with Git: -1. Get changes from upstream - * Via terminal: `git pull` - * If you don't get new commits from `upstream` repeat steps 7 & 8 of the setup. +0. Switch to the pregmod-master branch, then check for and merge any upstream updates + before updating your remote if any updates were avabile + * Via terminal: `git checkout -q pregmod-master && git fetch upstream && git merge upstream/pregmod-master && git push -q` -2. Checkout a new branch for your work +1. Checkout a new branch for your work * Via terminal: `git checkout -b <branch-name>` -3. Make your changes as you like -4. Commit your changes - * Via terminal: `git commit <files>` - * Make the commit message useful (`Fix X`, `Add Y`, etc.) +2. Make desired changes +3. Add them to be committed + * Via terminal: `git add *` +4. Commit + * Make the commit message useful (`Fix X`, `Add Y`, etc.) + * Via terminal: `git commit -m "MESSAGE"` 5. (optional, but recommended) Run sanityCheck before final push to catch any errors you missed. * You can ignore errors that already existed 6. Push result into your forked repository * Via terminal: - * Initially `git push -u origin <branch-name>` + * Initially: git push -u origin `git rev-parse --abbrev-ref HEAD` * Afterwards `git push` will suffice. 7. Create merge request through gitgud interface. + * Suggestion: Tick "Delete source branch when merge request is accepted." + to help automatically tidy up your fork. 8. Checkout `pregmod-master` in preparation of next change. - * Via terminal: `git checkout pregmod-master` + * Via terminal: `git checkout -q pregmod-master` 9. Once the merge request was accepted, delete your local branch. - * Via terminal: `git branch -d <branch-name>` + * Via terminal: `git branch -dq <branch-name>` + +To get a list of all current branches run `git branch --list` via terminal. -- GitLab