首页 > 其他 > 详细

【Git】Git工具常用命令

时间:2018-03-10 15:17:47      阅读:182      评论:0      收藏:0      [点我收藏+]

GitHub使用指南

 

 

.把本地代码上传到GitHub

0. 提前配置好上传地址

git config --global user.name “username”】

git config --global user.email “your email”】

 

【查看用户名和邮箱】

$ git config user.name

$ git config user.email

 

1.在需要上传的根目录下初始化仓库 

cd  待上传目录】

【git init】 #  当后来再同步到github时,不需要本行命令

 

 

2.把当前目录中的所有文件加入

【git add .】

 

3.提交到仓库

git commit -m “dicription of this code..”】

 

4.上传到GitHub

git remote add origin https://github.com/maruitao/dw2-workspace.git   #不是每次备份都必须找个命令

注意此步骤只是和https://github.com/maruitao/dw2-workspace.git 链接上,代码并没有推送

 

5.推送代码

git push -u origin master

 

6.下载代码

cd  $HOME

git clone https:github.com/mrt..

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

【Git】Git工具常用命令

原文:https://www.cnblogs.com/andre-ma/p/8538828.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!