github上面创建项目
- git上面-new repository --名称和本地项目名称一样
- git base here
- git init
- 通过idea提交
创建新分支
-
切换到被copy的分支(master),从服务器拉取最新版本
$git checkout master
$git pull -
从当前分支copy出新的开发分支 命名dev分支
$git checkout -b dev
Switched to a new branch ‘dev’ -
把新建的分支push到远端
$git push origin dev -
拉取远端分支
$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 If you wish to set tracking information for this branch you can do so with:git branch --set-upstream-to=origin/ dev -
关联
$git branch --set-upstream-to=origin/dev -
再次拉取 验证
git pull
新建分支
idea创建一个本地分支,然后远程同步创建一个分支