码迷,mamicode.com
首页 > 其他好文 > 详细

git Bash常用命令

时间:2015-10-30 18:20:51      阅读:240      评论:0      收藏:0      [点我收藏+]

标签:

1.Construct ssh key (If you want to commit to git server via THIS COMPUTER)

git config --global user.name " YOUR_USERNAME"
git config --global user.email "YOUR_EMAL@EMAIL.COM"
cd ~/.ssh
ssh-keygen -t rsa -C "YOUR_EMAIL@YOUREMAIL.COM"
【 then enter your passphrase

  after these operation , copy the content of "~/.ssh/id_rsa.pub" to the git server

 

2.Setup a new repository on your server

  Manually or via GUI      【 cz I don‘t know how to setup via bash :<

 

3.Commit your code to server

  If it‘s the first time you commit your code :

cd /your/source/code/folder
git init
git add .
git commit -m "first commit"
git remote add origin git@yourserver.com:username/project.git 
git push -u origin master

  Or if you have once commited :

git push -u origin master

 

4.Clone your code from server to PC

cd /your/destination/directory
git clone git@yourserver.com:username/repository.git

 

 

Ref:

http://blog.csdn.net/it_yuan/article/details/8638321

http://www.cnblogs.com/wenjiang/p/3161682.html

http://stackoverflow.com/questions/10285198/git-clone-fatal-remote-error-access-denied-or-repository-not-exported

git Bash常用命令

标签:

原文地址:http://www.cnblogs.com/pdev/p/4923751.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!