一、上传代码

  1. 在要上传的代码目录里点击鼠标右键,选择git bash here
    初始化git:
    git init //会自动创建一个隐藏文件夹.git
  2. 更新本文件夹下的文件被上传状态
    git status
  3. 添加将要上传的文件或文件夹,使用git add
    git add file
    注意:如果要上传文件夹,在文件夹后加上’’
    git add dir/
    也可以使用git add --all上传当前目录下的所有文件
  4. 添加代码提交的commit
    git commit -m "your commit here"
  5. 连接github建立的远程仓库链接,获取仓库的SSH地址:
    git基本操作使用总结执行:
    git remote add origin [email protected]:shuoyueqishi/spring-boot.git
  6. 从远程仓库更新
    git pull origin master --allow-unrelated-histories
    弹出的文件关闭之后会进行更新
  7. 最后push本地代码
    git push -u origin master

二、下载代码

  1. 新建存放下载代码的文件夹,进入文件夹
  2. 找到要下载的仓库的url
  3. 使用git clone url下载
    git clone [email protected]:shuoyueqishi/spring-boot.git

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2022-01-01
  • 2021-05-22
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-09-24
  • 2021-11-30
  • 2022-01-03
  • 2021-06-26
相关资源
相似解决方案