New project from scratch
- Create a new project via the webinterface.
- You'll see a summary with the next steps:
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
- Commit changes locally
git commit -a
Or at IMATH you can use git-commit, which will in every file replace $Id$ by User/timestamp:
git-commit
- Commit changes remote
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
Purge a file completely from all commits & branches
- This is not how GIT should be used!
- ONLY, ONLY, ONLY do this if it is absolutly necessary!
- There might be side effects, you're on your own!
$ cd <root of your repo> $ git-forget-file.sh <path to file>/<file>
Overwrite local branch with remote
Visually show commit history
gitg
- Use the git.math.uzh.ch webinterface
Search the commit which breaks something
- Based on binary search.
- Give a good and a bad commit.
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.