VCS、GIT
综合/最新
数据库老专题、运维
综合
GIT
仓库共2种:
git init repo # 创建 non-bare 仓库;.git/ + 源码。
git init --bare repo.git # 创建裸仓库;直接将 .git/ 做为根目录,无源码;Github 仓库即为该类型,git clone 等同 “git init + git remote add + git fetch + git checkout”,克隆要求目标文件必须为空,故可先改名,然后将源码文件手动复制进来。
清除所有历史记录 - 孤儿参数使新分支不继承历史记录
git checkout --orphan no_history
git add -A
git commit -am "init"
git branch -D main
git branch -m main
git push -f origin main