进入需要推送到git服务上的本地文件夹,然后打开Git Bash。

提交本地代码到git服务器
使用git init创建本地仓库。
提交本地代码到git服务器

然后去git服务器创建一个远程仓库,比如去github:
提交本地代码到git服务器
提交本地代码到git服务器

然后得到ssh,再按照“已存在的本地仓库”中给出的命令,把本地仓库的代码推送到新建立的远程仓库上即可。

这里使用git remote add origin [email protected]:willxiang/DAS_Starter.git先将本地仓库的远端地址设置一下。

提交本地代码到git服务器

然后使用add命令把代码添加到暂存区:
git add .(注意 最后有一个小数点)

提交添加的代码到本地仓库:
git commit -m '第一次提交'

然后使用命令git push -u origin master推送到远程服务器上,至此完成。




相关文章:

  • 2022-02-20
  • 2021-08-04
  • 2021-07-27
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-10
  • 2022-01-26
  • 2021-08-29
  • 2021-07-05
  • 2021-08-28
  • 2022-02-12
相关资源
相似解决方案