第一次上传
1git push -u origin main
-u
: This option, short for --set-upstream
, tells Git to set up a tracking branch. It associates the remote branch with the local branch you are pushing. By using this option, you can use the simpler command git push in the future without specifying the remote and branch names every time.
set default editor
1git config --global core.editor "nvim"
git 和远端分支比较
git diff main origin/main
删除远端分支
在网页端删除比较好。
1git push origin --delete repo2git push origin :repo
Rename a repo
在网页端 settings.
然后
1git remote set-url origin [email protected]:someuser/newprojectname.git
小体积拷贝
1git clone --filter=blob:none2git clone --filter=tree:03git clone --depth=1