S
sadscv
编辑于
•
发布于
Git
untrack file
This will tell git you want to start ignoring the changes to the file
git update-index --assume-unchanged path/to/file
When you want to start keeping track again
git update-index --no-assume-unchanged path/to/file
This command will cause git to untrack your directory and all files under it without actually deleting them:
git rm -r --cached <your directory>
The -r option causes the removal of all files under your directory.
The --cached option causes the files to only be removed from git's index, not your working copy. By default git rm <file> would delete <file>.
branch
查看历史
git log
切换到某次commit
git checkout 8afd
创建分支
git branch <branch_name>
切换分支
git checkout <branch_name>
创建+切换分支
git checkout -b <branch_name>
查看本地分支/所有分支
git branch
git branch -a
删除分支
git branch -d <branch_name>
推送到远程
git push origin <branch_name>
git reset
Head / Index /Working copy
-
Head ===> git commit 之后的文件
-
Index ===> git add 之后的文件
-
working copy ==>工作区文件
git reset --soft == (reset 1) 只改动Head,其余保留。
git reset(default) == (reset 1,2) 变动Head与Index, 保留工作区改动。
git reset --hard == (reset 1,2,3) 全部撤销。
阅读 2
评论 0