Skip to content
Snippets Groups Projects
Forked from pregmodfan / fc-pregmod
13380 commits behind the upstream repository.

Git setup & work cycle

First time setup

  1. Install Git for terminal or a Git GUI of your choice.

  2. 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.
  3. Fork the main repository through gitgud interface.

    • (optional) Delete all branches other than pregmod-master, so you don't get them locally when fetching.
  4. Clone the repo

    • Via terminal: git clone --single-branch https://gitgud.io/pregmodfan/fc-pregmod.git
  5. 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

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.
  2. 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.)
  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>
      • Afterwards git push will suffice.
  7. Create merge request through gitgud interface.

  8. Checkout pregmod-master in preparation of next change.

    • Via terminal: git checkout pregmod-master
  9. Once the merge request was accepted, delete your local branch.

    • Via terminal: git branch -d <branch-name>