git本地pull冲突解决办法
git stash
git pull
然后修改冲突的文件
zsh git diff from using a pager
git config --global --replace-all core.pager "less -F -X"
git在创建项目之后忘记添加gitignore办法
git clone
cd dirname
git rm -r --cached <file>
添加.gitignore文件
git add .gitignore
git commit -m "add git ignore"
git push -f origin master
git rm 文件后,没有commit之前恢复的操作
git rm file1
git reset HEAD file1
git checkout file1
Github sync a fork of a repository to keep it up-to-date
https://help.github.com/articles/syncing-a-fork/
https://help.github.com/articles/configuring-a-remote-for-a-fork/
git clone https://github.com/WisWang/website.git
git remote -v
git remote add upstream https://github.com/kubernetes/website.git
git fetch upstream
git merge upstream/master
vim content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md
git add content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md
git add *
git commit -m "keep repo update with offcial master"
git push
Resetting remote to a certain commit
git reset --hard
git push -f origin master
是本地分支与远程分支强制一致
git fetch --prune origin
git reset --hard origin/master
git clean -f -d
git 关闭分页,都在当前页显示
git config --global core.pager cat