GIT仓库初始化

吴书松
吴书松
发布于 2025-05-06 / 7 阅读
0

GIT仓库初始化

为了标识身份,建议先完成 Git 全局设置

git config --global user.name "wushusong" 
git config --global user.email "wushusong812@163.com" 

方式一:克隆仓库

git clone https:xxxxxxxxxxxxxx/test2

cd test2
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

方式二:已有文件夹或仓库

cd existing_folder
git init
git remote add origin https://codeup.aliyun.com/xxxxxxxx/test2.git
git add .
git commit
git push -u origin master

方式三:导入代码库

it clone --bare https://git.example.com/your/project.git your_path
cd your_path
git remote set-url origin https://codeup.aliyun.com/xxxxxxxx/test2.git
git push origin --tags && git push origin --all