git clone到非空目录并切换分支 Linux

mowen 2024-08-28 262

cd /opt
git clone --no-checkout 仓库地址 ./tmp
mv ./tmp/.git ./本地仓库目录
rm -rf ./tmp
cd ./本地仓库目录
git reset --hard HEAD
git checkout branch_name


最新回复 (0)
返回
发新帖
X