Forked from
pregmodfan / fc-pregmod
13380 commits behind the upstream repository.
gitSetup.md 2.22 KiB
Git setup & work cycle
First time setup
-
Install Git for terminal or a Git GUI of your choice.
-
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.
-
Fork the main repository through gitgud interface.
- (optional) Delete all branches other than pregmod-master, so you don't get them locally when fetching.
-
Clone the repo
- Via terminal:
git clone --single-branch https://gitgud.io/pregmodfan/fc-pregmod.git
- Via terminal:
-
Get updates
- Via terminal:
git pull
- Via terminal:
-
Setup your fork as a remote
- Rename the main repository to upstream
- Via terminal:
git remote rename origin upstream
- Via terminal:
- 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.
- Via terminal:
- Rename the main repository to upstream
-
Checkout
pregmod-master
- Via terminal:
git checkout pregmod-master
- Via terminal:
-
Make sure
fc-pregmod
tracksupstream/pregmod-master
- Via terminal:
git branch -u upstream/pregmod-master
- Via terminal:
Typical cycle with Git:
-
Get changes from upstream
- Via terminal:
git pull
- If you don't get new commits from
upstream
repeat steps 7 & 8 of the setup.
- Via terminal:
-
Checkout a new branch for your work
- Via terminal:
git checkout -b <branch-name>
- Via terminal:
-
Make your changes as you like
-
Commit your changes
- Via terminal:
git commit <files>
- Make the commit message useful (
Fix X
,Add Y
, etc.)
- Via terminal:
-
(optional, but recommended) Run sanityCheck before final push to catch any errors you missed.
- You can ignore errors that already existed
-
Push result into your forked repository
- Via terminal:
- Initially
git push -u origin <branch-name>
- Afterwards
git push
will suffice.
- Initially
- Via terminal:
-
Create merge request through gitgud interface.
-
Checkout
pregmod-master
in preparation of next change.- Via terminal:
git checkout pregmod-master
- Via terminal:
-
Once the merge request was accepted, delete your local branch.
- Via terminal:
git branch -d <branch-name>
- Via terminal: