1.已有主分支master,在自己新创的分支上开发
1.
git clone 项目地址
git checkout -b develop
git add .
git commit -m ""
git push origin develop
2.
git clone 项目地址
打开gitee新建分支
git pull
git checkout 分支名
git add .
#### **#### git commit -m ""**
git push origin 分支名
2.已有主分支master,在现有分支上开发
git clone 项目
git checkout 分支
git add .
git commit -m ""
git push origin 分支名
3.已有主分支master,但是master没有内容,先切换到有内容的分支,然后再新建分支
git clone 项目
git checkout develop
git checkout -b "我的分支"
git add .
git commit -m ""
git push origin 我的分支
4.git stash
使用方法:
1. git stash save "message":保存当前的工作进度,并添加一条注释。
2. git stash list:查看保存的工作进度列表。
3. git stash apply stash@{n}:恢复第n个工作进度,并将其应用到当前分支上。
4. git stash pop stash@{n}:恢复第n个工作进度,并将其应用到当前分支上,并从工作进度列表中删除。
5. git stash drop stash@{n}:删除第n个工作进度。
6. git stash clear:删除所有的工作进度。