码云多人协作
1.首先在项目所在的文件夹目录下打开终端,克隆项目链接(gitee中):
git clone https://gitee.com/bobbird/cueb_wms.git
2.查看当前项目中源代码的状态:git status
3.查看项目的当前所有分支:git branch
4.创建+切换分支:git checkout -b ruku
(如果想让码云立马显示自己所在的分支,可以输入: git push -u origin ruku。也可以等最后的时候统一推送。)
(当输入git push -u origin ruku,可能会报错,显示
fatal: ‘origin’ does not appear to be a git repository
fatal: Could not read from remote repository.
解决方法:重新关联远程仓库。git remote add origin https://gitee.com/bobbird/cueb_wms.git )
5.把所有的文件都添加到暂存区:git add .
(可能会报错,出现原因:原因是路径中存在 / 的符号转义问题,false就是不转换符号默认是true,相当于把路径的 / 符号进行转义,这样添加的时候就有问题。
解决办法:git config --global core.autocrlf false,然后重新添加。)
6.再检查状态:git status
7.把暂存区的所有代码提交到本地仓库中:git commit -m "这可以写日期和注释之类的"
8.查看分支:git branch
9.把代码推送到码云中: git push -u origin ruku
(我觉得加粗的是代码更新时需要操作的命令。这个需要到时候检查一下。)
查看分支:git branch
创建分支:git branch
切换分支:git checkout
创建+切换分支:git checkout -b
合并某分支到当前分支:git merge
删除分支:git branch -d
删除码云上的分支:git push --delete origin