Server Info |
|
Software |
|
Git push/pull access |
mainly via SSH over git@git.math.uzh.ch - do not forget to upload your public ssh key |
Cheat sheet |
|
Beginners Guide |
Contents
Git installed (already done on IMATH server).
To work with private GIT repos or to commit files, it's necessary to identify yourself. This is done via SSH Keys. Do this on all devices which you like to use with the GIT server (and in your I-MATH thinlinc session if you use it).
Setup SSH keys (per device) - HowTo create private/public ssh keys
Linux: On your device/session, push the keys to your ssh-agent
eval "$(ssh-agent -s)"
Via ssh: ssh -T git@git.math.uzh.ch (do not replace git with your username, use git@git.math.uzh.ch as written).
https://git.math.uzh.ch/users/sign_in > Tab 'MATH User'
Open your I-MATH account (based on your UZH Webpass account) under https://math.uzh.ch/account
https://git.math.uzh.ch/users/sign_in > Tab 'MATH User'
If you like to collaborate on a project which is hosted on https://git.math.uzh.ch, you have to request a git.math.uzh.ch account.
Best is to ask a project member affiliated with I-MATH to request the account via https://math.uzh.ch/support.
https://git.math.uzh.ch/users/sign_in > Tab 'Standard'
Recommended: You need to provide your public SSH key. This can easily be done on the Gitlab web-interface.
git COMMAND git@git.math.uzh.ch/<username>/<projectname>
Gitlab has quite extensive managing capabilities.
The gitlab user documentation is found on https://git.math.uzh.ch/help.
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 add <file>
git commit -a
Or at IMATH you can use git-commit, which will in every file replace $Id$ by User/timestamp:
git-commit
git push
git clone git@git.math.uzh.ch:<project>.git
$ git remote update --prune
$ cd <root of your repo> $ git-forget-file.sh <path to file>/<file>
gitg
The git bisect ... command always looks for the commit in the middle. Do a check of such a commit and decide to continue the search in the lower or upper half.
By using git the following error is shown:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Open a terminal and install xcode: a pop up have to acknowledged.
xcode-select --install
This leads to confusion. E.g.: after a fresh clone of a GIT repo (created on MS-Windows or linux) a git status will show untracked files if they contain umlaut in their filenames, even without any change has been done!
https://www.git-tower.com/help/guides/faq-and-tips/faq/unicode-filenames/mac
$ git config --global core.precomposeunicode false
# Status Quo $ git remote -v show origin https://systemvcs.math.uzh.ch/it/typo3-docker.git (fetch) origin https://systemvcs.math.uzh.ch/it/typo3-docker.git (push) # Remove Origin $ git remote rm origin # Set SSH Version $ git remote add origin git@systemvcs.math.uzh.ch:it/typo3-docker.git # Status Quo git remote -v show origin git@systemvcs.math.uzh.ch:it/typo3-docker.git (fetch) origin git@systemvcs.math.uzh.ch:it/typo3-docker.git (push) # Try a git pull: $ git pull # If you receive: There is no tracking information for the current branch. ... try: $ git branch --set-upstream-to=origin/main main
Attention: if you change to SSH and
than you should forward your SSH-Agent! E.g. ssh root@host -A