代码上传自己分支
-- 可以看到当前分支为xxx
git branch
-- 查看状态
git status
-- 代码为红色,需要添加到暂存区
git add .
-- 把暂存区内容提交
git commit -m "xxx"
-- commit之后后悔了想撤回
git reset --soft HEAD^
-- 上传到分支
git push -u origin xxx
自己分支代码合并到master
-- 切换到主分支
git checkout master
--把远程master的代码pull下来
git pull origin master
-- 合并xxx分支到master
git merge xxx
-- 查看状态
git status
-- push到远程master
git push origin master
网友评论