常用git命令

2021-08-27  本文已影响0人  胜利主义章北海

代码上传自己分支

-- 可以看到当前分支为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

上一篇 下一篇

猜你喜欢

热点阅读