sh 建立新的git回购

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 建立新的git回购相关的知识,希望对你有一定的参考价值。

#######################################################
# New machine (after installing and running git bash) #
#######################################################

# Check current settings
git config --list

# Read the docs
git help config

# Set global user settings:
# http://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
git config --global user.name "github username"
git config --global user.email "github email"

# Set the default text editor (optional)
git config --global core.editor "'C:/...editor.exe' -multiInst -nosession"

# setup ssh keys
# see gist 'git-ssh-keys.sh'

#######################################
# New repositories on a setup machine #
#######################################

# Clone existing remote repo
# go to directory with all repos
cd ~/repos
git clone git@github.com:<site-name>/<repo-name>.git

# Connect an existing repo to an existing remote origin
git remote add origin git@github.com:site-name/repo-name.git

# Connect an existing repo to a not-yet existing remote origin
# ...research

# Config for a single repository: just lose the --global
# http://stackoverflow.com/questions/8801729/is-it-possible-to-have-different-git-config-for-different-projects
cd ~/repos/repo-name
git config user.name "github username"
git config user.email "github email"

以上是关于sh 建立新的git回购的主要内容,如果未能解决你的问题,请参考以下文章

sh 克隆所有git回购

sh 清理恢复Git回购

sh Git将回购转移到另一个

sh 显示当前路径中的回购路径

sh 恰当地,当地的回购

sh Spotify的回购安装