PublicMathWiki: Git

Server

Server Info

git.math.uzh.ch

Software

Gitlab

Git push/pull access

mainly via SSH over git@git.math.uzh.ch - do not forget to upload your public ssh key

Cheat sheet

GIT for SVN users

Prerequisites

Create/Request an account

For Members of I-MATH

For Non-Members of I-MATH

If you wan't to collaborate with a project which is hosted on git.math.uzh.ch, you need to request a special Gitlab account. It's best if you write an email with a request to 'support AT math.uzh.ch'.

You will then receive an email for validation and first-time login.

After the first-time login

Login to Gitlab on `git.math.uzh.ch`

For Members of I-MATH

choose 'LDAP login'

For Non-Members of I-MATH

choose 'External login'

Working with Git

git COMMAND git@git.math.uzh.ch/<username>/<projectname>

Managing your Projects with Gitlab

Gitlab has quite extensive managing capabilities.

GIT Best Practise

New project from scratch

git.project.png

Git global setup
----------------
git config --global user.name "First Lastname"
git config --global user.email "email@math.uzh.ch"

Create a new repository
-----------------------
mkdir <local projektdir>
cd <local projektdir>
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin git@git.math.uzh.ch:<project>.git
git push -u origin master

Push an existing Git repository
-------------------------------
cd existing_git_repo
git remote add origin git@git.math.uzh.ch:<project>.git
git push -u origin master

GIT daily use

Local: Add new files to existing repo

git add <file>

Local: Work on your files

git commit -a

git-commit

git push

Local: clone an existing repo to start working on it

git clone git@git.math.uzh.ch:<project>.git

Purged Remote branches still shown locally

$ git remote update --prune

Visually show commit history

Search the commit which breaks something

PublicMathWiki: Git (last edited 2018-03-15 19:48:27 by crose)