how to

git.old

Jan 15, 2024
softwares-and-toolsgit
1 Minutes
128 Words

第一次上传

1
git 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

1
git config --global core.editor "nvim"

git 和远端分支比较

git diff main origin/main

删除远端分支

在网页端删除比较好。

1
git push origin --delete repo
2
git push origin :repo

Rename a repo

在网页端 settings.

然后

1
git remote set-url origin [email protected]:someuser/newprojectname.git

小体积拷贝

1
git clone --filter=blob:none
2
git clone --filter=tree:0
3
git clone --depth=1
Article title:git.old
Article author:Julyfun
Release time:Jan 15, 2024
Copyright 2025
Sitemap