git 使用整理
来源:互联网 发布:断电mysql修复 编辑:程序博客网 时间:2024/06/06 01:39
- 一般来说,HEAD 指针指向的是当前分支的最新版本。
- create a remote Git branch
1.git checkout -b feature/sh
2.git push origin feature/sh - A conflict-marked area begins with
<<<<<<<
and ends with>>>>>>>
. These are also known as the conflict markers. The two conflicting blocks themselves are divided by a=======
git checkout -- path/to/file
And that undoes any changes to the file.
An even easier way to undo all unstaged changes on current working directory [1]:
git checkout -- .
[1] - Be warned - you will lose any other unstaged changes you were working on (if any). If you don't know what you are doing, then keep a backup of the files you were working on :)
merge a git branch into master
git checkout mastergit pull origin mastergit merge testgit push origin master
git merge origin/fe
how to undo a git commit --amend
git reset --soft @{1}
- git checkout branch_name //切换到branch_name 的branch
- git checkout -- file.txt 替换掉本地的改动
- git log --pretty=oneline file.name
- git show 即可显示具体的某次的改动的修改
- git remote -v 查看远程仓库地址
- git branch 查看当前branch
- git branch -a //查看所有分支
- git reset HEAD a.txt//取消暂存文件
- git reset HEAD CONTRIBUTING.md
- git diff --cached 比较暂存区和版本库中上次提交的差异
- git diff --staged //比较的是工作目录中当前文件和暂存区域快照之间的差异
- git diff --full-index HEAD~ HEAD > /tmp/1.txt //本次commit和上次提交到repo的差异
- git diff --name-only
HEAD~ (which is the very first commit made to the repository), you can use eitherHEAD~~ orHEAD~2 HEAD^
means the first parent of the tip of the current branch.- git rm file1.txt 删除git (本地和远程)数据仓库的文件
- git mv:移动文件
- git commit --amend //修改最后一次提交
- git reset --hard commit_id // 彻底回退到某个版本,本地的源码也会变为上一个版本的内容
- git pull以在你的工作目录中 获取(fetch) 并 合并(merge) 远端的改动。
- git pull origin feature/1 //从分支拉取并合并代码
- git fetch origin feature/1 从分支拉取代码
- git merge origin/feature/
- git push origin master
- git stash 将文件给push到一个临时空间中
- git stash pop //将文件从临时空间pop下来
- git merge master 合并master分支到当前branch
- git status
- git submodule update --init --recursive
error and solve method:
- OSError: Failed to delete remote.origin.url: error: could not lock config file .git/config: Permission denied chmod -R user:group folder
Git: “Not currently on any branch.” Is there an easy way to get back on a branch, while keeping the changes?
git stashgit checkout some-branchgit stash pop
Git: “Not currently on any branch.” Is there an easy way to get back on a branch, while keeping the changes?
git stashgit checkout some-branchgit stash pop
若讀者想確認設定值,可使用 git config --list
命令列出所有Git能找到的設定值:
remove an entry in global configuration with git config?
I'm not sure what you mean by "undo" the change. You can remove the core.excludesfile
setting like this:
git config --global --unset core.excludesfile
And of course you can simply edit the config file:
git config --global --edit
Git Properties
Repository information can be set in a reviewboard.url property on the Git tree. Users may need to do this themselves on their own Git tree, so in some cases, it may be ideal to use dotfiles instead.
To set the property on a Git tree, type:
$ git config reviewboard.url http://reviewboard.example.com
A useful configuration to set is "color.ui". When set to "auto", Git will use text colors to highlight status information, e.g., untracked files will be displayed in red for "git status":
$ git config --global color.ui auto
- 【整理】git使用
- Git使用命令整理
- git 使用整理
- git日常使用整理
- 笔记-- git使用整理
- git使用命令整理
- git 使用整理
- git 使用整理
- Git基本使用整理
- git使用整理
- Git使用案例整理
- 整理 git的使用--菜鸟篇git
- git 日常使用命令整理
- 整理Git的命令使用
- Git使用技巧(整理)一
- GIT基本使用命令整理
- git和github使用整理
- Git使用整理(上)
- 225 Implement Stack using Queues
- 关于:after和:before伪类的用法,以及让浮动占据高度问题。
- The supeority of film faced plywood
- Scrapy框架 学习笔记2
- 作为计算机行业新人的思考
- git 使用整理
- PPT:阿里全息大数据构建与应用
- java使用ganymed-ssh2执行linux命令
- 九度oj 1069
- velocity第三个应用例子--遍历集合/数组
- input框 长度每变化一次触发一个事件
- VC6.0下64位整数的操作
- PHP
- 关于@synthesize和@dynamic的区别