1:使用AS创建本地项目,项目名以美团为例
2:紧接着需要进行版本管理,在码云或者gitlab等第三方远程仓库创建项目,(登录网址,注册,创建项目,邀请成员,然后获取项目的.git地址)
3:本地项目通过AS与远程仓库关联,大致流程如下
参考链接:https://blog.csdn.net/u013184970/article/details/88660722
4:本地仓库与远程仓库关联之后就可以正常的提交和更新代码了,但是此时通常只有master分支,还需要创建开发分支来提高效率,参考以下链接
https://www.cnblogs.com/ampl/p/11000042.html
1. 切换到被copy的分支(master),从服务器拉取最新版本
$git checkout master
$git pull
2. 从当前分支copy出新的开发分支 命名dev分支
$git checkout -b dev
Switched to a new branch 'dev'
3. 把新建的分支push到远端
$git push origin dev
4. 拉取远端分支
$git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> dev
pull时发现,当前的分支并没有和本地分支关联,根据提示进行下一步:
5. 关联
$git branch --set-upstream-to=origin/dev
6. 再次拉取 验证
$git pull