# gitone **Repository Path**: zl521web/gitone ## Basic Information - **Project Name**: gitone - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-06-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GIT 学习资料笔记 ## 1 课程介绍 ## 2 git基础 ## ==git init==初始化Git仓库 工作区 -> 暂存区域 - `git add <文件名称或者目录>` 提交工作区域到暂存区域 工作区 -> 暂存区 -> 本地版本库 - `git commit -m "提交的注释"` 提交 本地版本库 - `git status` 查看工作区域状态 - `git diff <文件名/目录名称> [--cached]` 版本对比对比 ## ==git log== 查看版本 - `git log -2` 前两次 - `git log -p -2` - `git log --stat` 查看版本更新重大一堆+++++++缩略行 - `git log --oneline` 看一行 ## ==git reset== 回到某个区域 - `git reset --hard<前5位版本号>` 强制就可以重置 - `git reset <前5位版本号>` 重置 - `git reset --soft` 加载到暂存区 - `git reset --hard HEAD^` 向上或向下 ## ==git rm== 删除 - `git rm ` - `git rm --cached ` - `git mv <文件原来位置> <文件目录新位置>` - `git mv <文件的旧名字> <文件的新名字>` ## ==git remote== 设置远程服务器 - `git remote add <别名>` - `git remote remove<别名>` 删除 - `git remote show` 显示 - `git remote -v` 更明确所有 - `git remot rename <旧名字> <新名字>` 改名 ## ==git push== 提交到 - `git push <版本分支>` - `git push -u ` 默认的 - `git push --all` 推送所有的分支到服务器 - `git push --force` 强制上传 - `git push --tags` 标签标记 ## ==git branch== 分支 - `git branch ` 建立新的分支 - `git checkout ` 切换到分支 - `git checkout -b ` 等于 `git branch ` + `git checkout ` - `git branch -D <分支名字>` 删除分支命令行中 - `git branch` 查看 - `git rebase` 合并分支(合并到主分支 别人的为主线) ## ==merge== 合并 - `git merge <分支名称>` 合并分支 ## ==git tags== - `git tag` 查看标签 - `git tag -a ` -m <名字注释描述> - `git show ` 显示标签 - `git push ` - `git push --tages` 一个标签 ## 项目规则 ## git pull - git clone - git pull 同步到本地 - git fetch 更新远程版本库到本地版本库 但不更新工作区域 - git pull : ## 工作镜像区 - git stash [save "msg"] - git stash list - git stash apply/pop stash@{n} - git stash drop stash@{n} - git stash clear - git show stash@{n}