• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
星之寒
博客园    首页    新随笔    联系   管理    订阅  订阅
本地项目git初始化并提交远程仓库

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
# Pushes the changes in your local repository up to the remote repository you specified as the origin
————————————————
版权声明:本文为CSDN博主「dujianxiong」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/dujianxiong/article/details/78991166

posted on 2020-04-07 11:53  星之寒  阅读(1035)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3