git学习笔记

欢迎阅读 git学习笔记

1. 基础操作指令

git add (工作区——>暂存区)
git commit (暂存区——>本地仓库)
git log (查看提交记录)
git status (查看工作区状态)
git reset (版本切换)
git reflog (查看所有提交记录)

2.分支

git branch (查看分支)
git branch xxx (创建分支)
git checkout xxx (切换分支)
git merge xxx (合并分支)
git branch -d xxx (删除分支)

3.远程仓库

git remote add origin xxx (添加远程仓库)
git remote -v (查看远程仓库)
git push origin master (推送到远程仓库)
git pull origin master (从远程仓库拉取 自动合并)
git push —set-upstream origin master (绑定分支)
git clone xxx (克隆远程仓库)

git fetch (抓取)

4.解决冲突

1.git pull
2.git push