Difference between revisions of "Git / Gitlab"
(→Get access to GitLab) |
(→With no write access) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 26: | Line 26: | ||
You have 2 options to clone a repository: | You have 2 options to clone a repository: | ||
− | * SSH (requires a SSH key | + | * SSH (requires a SSH key set up in [https://git.linuxmce.org/profile/keys GitLab]) e.g. <code>git clone git@git.linuxmce.org:ochorocho/gitlab-irc.git</code> |
− | * HTTPS e.g. git clone https://git.linuxmce.org/ochorocho/gitlab-irc.git | + | * HTTPS e.g. <code>git clone https://git.linuxmce.org/ochorocho/gitlab-irc.git</code> |
== Workflow == | == Workflow == | ||
Line 37: | Line 37: | ||
Even if you have write access you can use this method. | Even if you have write access you can use this method. | ||
− | # Fork a repository | + | # Fork a repository [[File:Git fork.png|thumbnail]] |
+ | # Clone your fork: <code>git clone git@git.linuxmce.org:YOUR_USER_NAMESPACE/linuxmce.git</code> | ||
# Do your stuff, implement features, fix bugs etc. | # Do your stuff, implement features, fix bugs etc. | ||
− | # Make "Pull Request" for your changes | + | # Commit and push your changes to your fork: <br /><code>git add . && git commit -m 'YOUR MEANINGFUL MESSAGE WITH TICKET NUMBER' && git push</code> |
+ | # Make "Pull Request" for your changes. | ||
+ | ## Goto your fork in Gitlab '''https://git.linuxmce.org/YOUR_USER_NAMESPACE/linuxmce | ||
+ | ## Navigate to '''Merge Requests -> New merge''' request | ||
+ | ## Select the two branches in your fork and the origin repository you want to compare with. Compare by clicking '''Compare branches and continue''' | ||
+ | ## Give a title and a description about what you intended to change/improve/add and click on '''Submit merge request''' | ||
# "Pull Request" will be verified and merged by a LinuxMCE Dev, please be patient | # "Pull Request" will be verified and merged by a LinuxMCE Dev, please be patient | ||
Latest revision as of 22:31, 27 November 2017
Contents
GitLab / GIT
GitLab is the web interface of choice for managing GIT repositories.
A list of features: https://about.gitlab.com/features/
Additional Info:
- GitLab URL: https://git.linuxmce.org/
- Repository URL: https://git.linuxmc.org/< username / group name >/< project name >.git
Get access to GitLab
Go to IRC #linuxmce-devel and ask for a Account.
To create an account we need following information:
- Name
- Username
As soon as your account was created you'll receive an E-Mail containing a link to set your password. Klick on that link and set your password, then you are ready to login. No mail received? Check your spam/junk folder.
Clone repository
You have 2 options to clone a repository:
- SSH (requires a SSH key set up in GitLab) e.g.
git clone git@git.linuxmce.org:ochorocho/gitlab-irc.git
- HTTPS e.g.
git clone https://git.linuxmce.org/ochorocho/gitlab-irc.git
Workflow
We have no fine grained workflow at the moment and no continous integration.
With no write access
Even if you have write access you can use this method.
- Fork a repository
- Clone your fork:
git clone git@git.linuxmce.org:YOUR_USER_NAMESPACE/linuxmce.git
- Do your stuff, implement features, fix bugs etc.
- Commit and push your changes to your fork:
git add . && git commit -m 'YOUR MEANINGFUL MESSAGE WITH TICKET NUMBER' && git push
- Make "Pull Request" for your changes.
- Goto your fork in Gitlab https://git.linuxmce.org/YOUR_USER_NAMESPACE/linuxmce
- Navigate to Merge Requests -> New merge request
- Select the two branches in your fork and the origin repository you want to compare with. Compare by clicking Compare branches and continue
- Give a title and a description about what you intended to change/improve/add and click on Submit merge request
- "Pull Request" will be verified and merged by a LinuxMCE Dev, please be patient
With write access
Master is always deployable, so we must not work on Master at any time!
Master is only used for merge in working stuff.
- Clone a repository
- Branch of from Master
- Do your stuff, implement features, fix bugs etc.
- Commit/Push your branch - on bigger changes i would recommend doing a test build using this branch
- Merge your changes into Master
- Push the verified changes to master
GitLab IRC
To enable IRC notifications for your project add a Web Hooks (Settings -> Web hook) with the URL http://localhost:4567/commit Somehow GitLab seems to ignore "Trigger". When only checked "Push events" it's still triggered for Comments, Issue events etc.
Because of that fact i extended the config.yml of giltab-irc (/home/git/gitlab-irc/config/config.yml) to have at least the option to configure notifications globally.
Following options for notifications:
msg: push: true tag_push: false issue: true note: false short_uri: true
To start gitlab-irc run:
/etc/init.d/gitlab-irc start
Useful links
- GIT clients: http://git-scm.com/downloads/guis
- GIT Docs: http://git-scm.com/docs
- Cheatsheet / Commands:
- Merge vs. Rebase: https://www.atlassian.com/git/tutorials/merging-vs-rebasing/conceptual-overview