菜鸡自学之路 _ Git

98 阅读1分钟

What is Git

  • 分布式版本控制工具

Gitlab

  • 基于局域网 不公开

  • 每一次文件提取操作,实际就是一次对于文件仓库的克隆

git 相关命令

git add 提交到暂存区 git status 查看状态 git commit -m 'related message' (file) git reflog 查看版本信息 git log 查看版本详细信息 git reset --hard (version) git branch -v 查看分支 git branch (name) create branch git checkout (name) switch branch git merge (要合并的分支) notice:在要被合并的分支上操作

git 合并冲突

reason: 合并分支后,两个分支在同一个文件的同一个位置有两套完全不同的修改

处理方法:合并后手动修改 <<<<<<<< HEAD ======== >>>>>>>>>>>中的冲突部分 之后git add 文件 then直接git commit 就行,不用带文件名

Gitlab