Git 最佳实践相关文章:
用git 在本地建个分支,再传到远程并建新分支的语法: git checkout -b git push -u origin
IDEA 中 SVN的状态,文件显示青绿色时,表示同一个项目中svn各个目录指向的branch不同,如:有的在trunk,有的在branch,通常这种情况是在切换branch时异常中断引起的,这时需要将根目录重新指向另一个branch,再指向回来。
Git export pure code:
stackoverflow.com/questions/1… git archive --format zip --output /full/path/to/zipfile.zip master git archive --format zip --output /path/to/outputflie.zip branchName
Git修改历史的某次提交
10段超有用的Git命令行代码
Git教程 显示清楚的历史过程: git log --pretty=oneline
回退到上一个版本: git reset --hard HEAD^ 穿梭到任意一个版本(历史的或之后的): git reset --hard 3628164 列出所有历史操作记录(包括版本id等): git reflog
git: forever remove files or folders from history
#!/bin/bash set -o errexit
Author: David Underhill
Script to permanently delete files/folders from your git repository. To use
it, cd to your repository's root and then run the script with a list of paths
you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then exit 0 fi
make sure we're at the root of git repo
if [ ! -d .git ]; then echo "Error: must run this script from the root of a git repository" exit 1 fi
remove all paths passed as arguments from the history of the repo
files=files" HEAD
remove the temporary history git-filter-branch otherwise leaves behind for a long time
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune