首页 > 其他 > 详细

本地项目git初始化并提交远程仓库

时间:2019-09-16 14:28:53      阅读:310      评论:0      收藏:0      [点我收藏+]

1、先在远程仓库(如github)创建项目,为了避免错误,不要初始化 README, license, 或者gitignore文件 .

2、打开Terminal终端

3、切换到你的本地项目目录

4、初始化本地仓库

git init

  

5、添加文件到本地仓库

git add .

6、提交文件 

 

git commit -m "First commit"

7、到远程仓库的页面上,复制仓库地址 (笔者以配置好ssh,故复制ssh形式的仓库地址)

8、添加远程仓库地址到本地仓库

 

git remote add origin {远程仓库地址}
# Sets the new remote
git remote -v
# Verifies the new remote URL

9、push到远程仓库

git push -u origin master

  

本地项目git初始化并提交远程仓库

原文:https://www.cnblogs.com/wangkongming/p/11527001.html

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