文章目录
- [1 Visul Studio使用git控制版本](#1 Visul Studio使用git控制版本)
-
- [1.1 git remote -v](#1.1 git remote -v)
-
- [1.1.1 myrepo 是你自己 fork 到 GitHub 上的仓库(estimate123/LXL_XV6_LAB)。](#1.1.1 myrepo 是你自己 fork 到 GitHub 上的仓库(estimate123/LXL_XV6_LAB)。)
- [1.1.2 origin 是 MIT 课程官方源,地址是 git 协议(git://)。](#1.1.2 origin 是 MIT 课程官方源,地址是 git 协议(git://)。)
- [1.2 git push](#1.2 git push)
1 Visul Studio使用git控制版本
1.1 git remote -v
用途:查看当前目录下对应的远程仓库的名称 与地址
Visual Studio当前git情况

bash
PS D:\Study\VMShareFolder\xv6-labs-2020> git remote -v
myrepo https://github.com/estimate123/LXL_XV6_LAB.git (fetch)
myrepo https://github.com/estimate123/LXL_XV6_LAB.git (push)
origin git://g.csail.mit.edu/xv6-labs-2020 (fetch)
origin git://g.csail.mit.edu/xv6-labs-2020 (push)
这台机器里给同一个仓库登记了 两个远程(remote),一个叫 myrepo,一个叫 origin。
含义一行行看:
1.1.1 myrepo 是你自己 fork 到 GitHub 上的仓库(estimate123/LXL_XV6_LAB)。
地址是 HTTPS,可以读也可以写(只要你登录过 GitHub)。
1.1.2 origin 是 MIT 课程官方源,地址是 git 协议(git://)。
git 协议默认只读,而且 MIT 那边并没有开放写权限给全世界,所以只要执行
git push origin syscall
服务器就会返回
fatal: remote error: access denied or repository not exported: /xv6-labs-2020
------正是你刚才看到的那句。
1.2 git push
当前在branch syscall的情况下,想要push代码使用以下命令
bash
git push myrepo syscall