1
git init
2
git add .
3
查询状态
git status
4
git commit -m ‘messge‘
5
git remote add origin xxxxx(这里是网址,在你空仓库的首页中code页面最上部分的文本框中可以找到。一般是https://github.com/账户名称/空仓库名称)
git remote rm origin (当出现错误时,可以将其删除,重新创建)
6
git push -u origin master
问题1
报错信息
remote: error: Trace: 62a75df3a7549a028d6db300346d869ebe2be48b4dd7ceb45bc370ad6b2ced12
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File optimal/src/.vscode/browse.vc.db is 284.37 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
optimal/src/.vscode/browse.vc.db 文件太大需要删除
解决1
git rm --cached /media/sp/lx/ubuntu/event_camera/optimal/src/.vscode/browse.vc.db
git commit --amend -CHEAD
问题2
error: RPC failed; curl 55 Failed sending data to the peer
fatal: The remote end hung up unexpectedly
解决2
git config --local http.postBuffer 524288000
问题3
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
解决3
token问题:https://blog.csdn.net/weixin_41010198/article/details/119698015?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165778270816782391888653%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=165778270816782391888653&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~baidu_landing_v2~default-4-119698015-null-null.142^v32^experiment_2_v1,185^v2^control&utm_term=remote%3A%20Support%20for%20password%20authentication%20was%20removed%20on%20August%2013%2C%202021.%20Please%20use%20a%20personal%20access%20token%20instead.&spm=1018.2226.3001.4187
问题4
fatal: unable to access 'https://github.com/Cmome/event_camera.git/': Failed to connect to github.com port 443: Connection timed out
解决4
sudo gedit /etc/hosts
打开/etc/hosts文件,将github.com对应的行屏蔽掉