Git基操记录
2022-01-13 15:43:58

小结

说多了都是泪,最近在整理Java的笔记,记笔记我比较喜欢使用markdown(当时使用Hexo的原因之一),毕竟作为刚入门槛一点点的程序小白,还没用上Idea(很多大佬都推荐这个),目前还在使用Visual Studio Code,主要是方便而且轻快,装了一个Git的插件,将Github上的库克隆到本地直接用Visual Studio Code写,为了图方便pull,就使用了Git的插件,结果写完一提交就error,没仔细看一想,可能电脑清理了没有设置git的user和email吧,习惯性的git config…,弄完之后再提交,timeout:443,想了想,没设置全局的代理,毕竟国内网络直通>不了Github,又git config…了一波,终于success了

详情

Git设置代理

git config –global https.proxy http://127.0.0.1:1080
git config –global https.proxy https://127.0.0.1:1080
git config –global http.proxy socks5://127.0.0.1:1080
git config –global https.proxy socks5://127.0.0.1:1080

Git设置账户

git config –global user.name “username”
git config –global user.email “useremail”

配置密钥

ssh-keygen -t rsa -C “useremail”
接下来的操作参考Hexo搭建的相关过程

检测Git配置信息

git config –list

克隆仓库

git clone https://…….
git clone https://……. 已有仓库

检测文件状态

git status

提交更改

git commit -m “Input commt message”

删除文件

git rm < file name>

查看历史记录

git log

补充

取消代理设置

git config –gloabl –unset https.proxy
git config –global –unset http.proxy

Prev
2022-01-13 15:43:58
Next