git提交到远程命令:
1.本地建立git仓库,cd到根目录:git init
git 仓库创建与关联
2.将项目所有文件添加到仓库缓冲区(避免误操作的区域,只是一个中转作用):git add . 
git 仓库创建与关联
若要添加某个特定文件到仓库,则把.换成该文件名即可
git 仓库创建与关联
3.将add的文件commit到仓库版本区:git commit -m "注释语句"
git 仓库创建与关联
4.在github上创建仓库:
git 仓库创建与关联
5.点击Create repository创建仓库并获取它的链接地址用于关联本地仓库:
git 仓库创建与关联
6.本地仓库关联远程github:
git 仓库创建与关联
7.在将文件上传到github时,先pull:git pull origin master
git 仓库创建与关联
8.最后上传代码:git push -u origin master
git 仓库创建与关联
报错:拒绝合并无关历史
9.添加命令,允许合并无关历史:--allow-unrelated-histories
git 仓库创建与关联
10.再git push:输入用户名,密码之类。
git 仓库创建与关联
11.查看github,已完成Push

git 仓库创建与关联

12.git status:列出当前所有还没有被git管理的文件以及被git管理且已经修改过但还未提交的文件。
git 仓库创建与关联

13.git log:查看提交记录
git 仓库创建与关联

14.git diff: 查看修改记录,查看工作区和缓冲区文件的差异
git 仓库创建与关联
15.如果不想每次push都输入用户名与密码,可在G:\msys64\home\stanway目录下:
touch .gitconfig
填上:
git 仓库创建与关联

相关文章:

  • 2021-08-04
  • 2021-04-25
  • 2021-12-13
  • 2021-09-02
猜你喜欢
  • 2022-12-23
  • 2021-04-02
  • 2021-08-16
  • 2022-02-11
  • 2021-09-11
  • 2021-08-20
  • 2021-12-16
相关资源
相似解决方案