GIT

Git Bash Notes

git bash$ winpty docker run -it ubuntu /bin/bash Prefixing the path with a double slash (//bin//bash) or set MSYS_NO_PATHCONV=1 http://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line#34386471 https://github.com/git-for-windows/git/issues/577#issuecomment-166118846

git管理大文件

https://git-lfs.github.com/

分叉拉取模式(fork and pull model)

GITHUB两种主要的pull request的开发模式 分叉拉取模式 任何开发人员可以在项目源仓库(upstream)分叉,然后仓库该分叉(origin)到本地文件系统进行开发 测试,测试完毕提交到分叉origin,并发送pull request到源仓库upstream, 源仓库维护人员评审 更改,并最终决定是否合并该更改到源仓库 在发送pull request之前,好几个开发人员共同为一个特性协作开发, 互相从对方的仓库拉取代码。 这时,从对方的仓库拉取代码简化重新定义一个remote,该remote把本地的分叉指向对方仓库地址。 https://github.com/wubigo/wubigo.github.io 单击Fork按钮(右上角) GITHUB把该仓库代码复制到自己的github账号,建立分叉仓库 打开git命令行客户端,把分叉仓库克隆到本地环境 git clone https://github.com/$USER_NAME/wubigo.github.io.git cd wubigo.github.io git remote add upstream [email protected]:wubigo/wubigo.github.io.git # Never push to upstream master git remote set-url --push upstream no_push # Confirm that your remotes make sense: git remote -v origin https://github.com/Fuang/wubigo.github.io.git (fetch) origin https://github.com/Fuang/wubigo.github.io.git (push) upstream [email protected]:wubigo/wubigo.github.io.git (fetch) upstream [email protected]:wubigo/wubigo.github.io.git (push) 同步本地代码到upstream git fetch upstream git checkout master git rebase upstream/master git push 查看各个分支的最新提交ID

Gitlab Notes

push to a mirror repository push to github at same time when a commit is pushed to gitlab Protected Branches By default, protected branches are designed to: prevent their creation, if not already created, from everybody except Maintainers prevent pushes from everybody except Maintainers prevent anyone from force pushing to the branch prevent anyone from deleting the branch Project members permissions NOTE: In GitLab 11.0, the Master role was renamed to Maintainer The following table depicts the various user permission levels in a project.