一、首次使用授权
git bash里配置ssh key
ssh-keygen -t rsa -C "xxx"
cat ~/.ssh/id_rsa.pub
二、clone项目
git clone git@xxx.git
git branch
git branch dev
git checkout -b dev
git reset --hard
三、push项目
进入到clone的项目目录中
cd xxx
*此时新项目直接push文件会报错:git push origin master
/****************创建新项目需注意先建立README文件再push**********************/
touch README
git add README
git commit -m 'first commit'
git push origin master
git add folder1
git add xxx.py
git add *.py
#查看文件状态,若存在untracked files继续add
git status
git commit -m '123'
git push origin master
gitlab使用攻略
最新推荐文章于 2025-03-10 17:41:57 发布