Gitlab notes
InstallEdit
SMTP setup[1]Edit
Edit the file:
/etc/gitlab/gitlab.rb
and add relevant SMTP details similar to:
gitlab_rails['smtp_enable'] = true gitlab_rails['smtp_address'] = "smtp.server" gitlab_rails['smtp_port'] = 465 gitlab_rails['smtp_user_name'] = "smtp user" gitlab_rails['smtp_password'] = "smtp password" gitlab_rails['smtp_domain'] = "example.com" gitlab_rails['smtp_authentication'] = "login" gitlab_rails['smtp_enable_starttls_auto'] = true gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
I inspected my SMTP settings in a known-good mail client (Thunderbird) Then reconfigure Gitlab by executing:
gitlab-ctl reconfigure
Generate SSH keys to apply to a Gitlab account[2]Edit
Run ssh-keygen to generate the key (on the server).
ssh-keygen -t ed25519 -C "<comment>"
The comment is included in the .pub file that’s created. You may want to use an email address for the comment. Output similar to the following is displayed:
Generating public/private ed25519 key pair. Enter file in which to save the key (/home/user/.ssh/id_ed25519):
Accept the suggested filename and directory, unless you are generating a deploy key or want to save in a specific directory where you store other keys.
Specify a passphrase.
A confirmation is displayed, including information about where your files are stored. A public and private key are generated. Copy the public key to your Gitlab account (i.e. in the web interface). https://docs.gitlab.com/ee/user/ssh.html#add-an-ssh-key-to-your-gitlab-account
Optimising for small server[3]Edit
Edit:
/etc/gitlab/gitlab.rb
Note that there are many more options to try in the reference. These massively improved my situation:
puma['worker_processes'] = 0 sidekiq['max_concurrency'] = 10 prometheus_monitoring['enable'] = false
Then reconfigure Gitlab by executing:
gitlab-ctl reconfigure
Convert an existing VS solution folder into a git repo and create a new gitlab project and upload it[4]Edit
Use the git bash interface and enter commands like:
cd "C:\Users\dave\source\repos\myWickedProject" git init git add . git checkout -b master git commit -m "Initial commit from cmdline" git push --set-upstream https://myscmserver.com/dave/myWickedProject.git master
No need to create a blank project first.
Fix reposEdit
git fsck git gc
TipsEdit
Temporarily switch to a different commit[5]Edit
If you want to temporarily go back to it, fool around, then come back to where you are, all you have to do is check out the desired commit:
# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32
Or if you want to make commits while you're there, go ahead and make a new branch while you're at it:
git checkout -b old-state 0d1d7fc32
To go back to where you were, just check out the branch you were on again. (If you've made changes, as always when switching branches, you'll have to deal with them as appropriate. You could reset to throw them away; you could stash, checkout, stash pop to take them with you; you could commit them to a branch there if you want a branch there.)
Reverting Working Copy to Most Recent CommitEdit
To revert to the previous commit, ignoring any changes:
git reset --hard HEAD
where HEAD is the last commit in your current branch
ReferencesEdit
- ↑ https://docs.gitlab.com/omnibus/settings/smtp
- ↑ https://docs.gitlab.com/ee/user/ssh.html
- ↑ https://docs.gitlab.com/omnibus/settings/memory_constrained_envs.html
- ↑ https://stackoverflow.com/questions/33101962/how-to-create-a-new-gitlab-repo-from-my-existing-local-git-repo-using-cli
- ↑ https://stackoverflow.com/questions/4114095/how-do-i-revert-a-git-repository-to-a-previous-commit