git的使用

1 git 常用命令

git init  #  生成一个.git 的文件夹
git status  #  查看状态(红色和绿色),必须全绿再提交到版本库
git add .  #  将工作区的所有内容提交到暂存区
git commit -m '提示文字'  #  将暂存区的内容提交到版本库
git clone 仓库链接  #  克隆远程仓库
git git reset --head 版本号  #  回滚到某个版本(通过改变头指针)
git branch  #  查看所有分区
git branch 分支名  #  创建分支
git chekout 分支名  #  切换到指定分区
git branch -d 分支名  #  删除分区
git merge 分支名  #  合并分区(在其他分区执行)
git pull origin master  #  文件夹中的代码成为最新的
git push origin master  #  把本地的master分支提交到远程的origin
git checkout . #  表示回到指针指向的版本
git remote add origin 远程仓库链接  #  连接远程仓库

2 git 产生冲突的两大原因

-分支合并
-你和其他人再同一条分支上改了相同的代码
posted @ 2022-08-07 21:09  mress  阅读(25)  评论(0)    收藏  举报