# GIT_README **Repository Path**: anderf/GIT_README ## Basic Information - **Project Name**: GIT_README - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2018-01-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # install a git client in windowsa 1. install *Git Shell*: [http://git-scm.com/downloads](http://git-scm.com/downloads) 2. install *TortoiseGit*: [http://download.tortoisegit.org](http://download.tortoisegit.org) 3. git book **Pro Git**: [http://git-scm.com/book/zh/v1](http://git-scm.com/book/zh/v1) # add ssh keys with git shell(windows) or linux shell to gitlab 1. `ssh-keygen -t rsa -C "598684709@qq.com"` 2. copy the text of file (`cat ~/.ssh/id_rsa.pub`) to gitlab # init git config 1. git config file: - system: `/etc/gitconfig` - user : `~/.gitconfig` - repo : `.git/config` 2. init configuration - `git config --global user.name "fangjuncheng"` - `git config --global user.email "598684709@qq.com"` - `git config --global color.ui true` - `git config --global push.default simple` - `git config --global core.editor gvim.exe` - `git config --global merge.tool gvimdiff.bat` - `git config --global core.autocrlf false` - `git config --list` # test if linked to GitHub - `ssh git@github.com` - `ssh git@gitee.com` # Create a new repository - `git clone ssh://git@linux-dev-oa-server:50022/fangjuncheng/app.git` - `cd app` - `touch README.md` - `git add README.md` - `git commit -m "add README"` - `git push -u origin master` # Existing folder or Git repository - `cd existing_folder` - `git init` - `git remote add origin ssh://git@linux-dev-oa-server:50022/fangjuncheng/app.git` - `git add .` - `git commit` - `git push -u origin master` # create project: 1. create new project with private access and add members: - added as developer with commit privacy users - added as reporter with only merge request users - added as guest with no fork privacy users 2. fork a exist project with private access anbd add members: - added as developer with commit privacy users(your self) - added as reporter with privacy to deal with your merge request users, your team leader and code checker users - added as guest with no fork privacy users # general development for all user 1. for init - fork a repo on web. - clone repo to local * `$git clone http://xxxx/fangjuncheng/app.git` * `$cd app` * `$git remote add upstream http://xxxx/up/app.git` 2. for sync local repo with myrepo and upstream - `$git pull` - `$git fetch upstream` - `$git merge upstream/master` 3. do something with files and commit to myrepo - `$git commit -a /your/file/path` - `$git push` 4. login to web repo, create a new merge request