跳到主要内容

git

Command


git config --global user.name "yourname"
git config --global user.email "your@email.com"
git merge --squash dev # 合并dev到当前分支,将所有提交合并为单一提交
git add .
git commit -m "feature" --date="2025-8-01T12:35:00+0800"
git push


删除远程分支
git branch -D dev
git push origin --delete dev

######################创建一个空的分支
git init -b main
git remote add origin xxxxxxxxxxxxxxxxxxx
git checkout --orphan main
git commit --allow-empty -m "Initial commit on empty main branch"
git push --set-upstream origin main
git checkout -b snapshot
git push --set-upstream origin snapshot