1、win10右键添加在此处打开powershell
在文件夹空白处,按住shift同时鼠标右击
2、本地仓库和码云仓库进行关联
创建 git 仓库:
cd test
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/dreanFly/testgit.git
git push -u origin master
已有仓库?
cd test
git remote add origin https://gitee.com/dreanFly/testgit.git
git push -u origin master
3、git常用命令
查看仓库状态:git status
红色字体代表没有在本地仓库中缓存的文件
把本地文件加入到本地仓库缓存中:git add .
把文件提交到本地:git commit -m "test commit"
test commit是提交的说明
提交到码云的master 分支:git push -u origin master
如果码云上有当前分支可以使用:git push;无需加后面的参数,使用后面的参数会创建分支
创建test分支:git checkout -b test
切换master分支:git checkout master
查看所有分支(绿色代表当前分支):git branch
分支合并:git merge test
把test分支合并到当前分支
提交到码云仓库使用步骤:
1、把本地仓库与码云仓库关联
2、把本地文件加入缓存区
3、把本地代码提交到本地仓库
4、把本地仓库同步到码云仓库
分支同步步骤:
1、切换到需要同步的分支
2、执行同步分支命令,指定合并的分支