Archive for the ‘版本控制 | git’ Category
Fix Gitlab doesn’t show branches other than master
Gitlab 6.x
Most likely, it is a cache issue.
cd /home/git/gitlab
su git
bundle exec rake cache:clear RAILS_ENV=production
Slow Git status over NFS storage system
NFS has serious performance issue.
Running “git status” in virtualbox with direct attached storage for a 200M repo is almost instantly.
However, if the repo is attached to the VM via NFS, it could take miniute just to run the same command.
According to this page. http://stackoverflow.com/questions/4994772/ways-to-improve-git-status-performance, this boils down to the inefficiency of NFS for lstat command and cannot be solved.
I have also experienced similar performance issue when mounting high performance disk array via NFS.
The performance is much worse than directed attached system. However, without NFS, I’m not aware of any other cheap technology to achieve virtual storage.
Hope someome could shed the light
使用Git同步配置文件(DotFiles)
主要还是参考vimcast上的介绍。
首先,可以考虑将~/下需要同步的配置文件移到一个专用的目录,以免不小心将私人信息泄露出去。
然后,再通过建立符号链接回原来的目录。
比如
ln -s /Users/Share/Configuration/.vim ~/.vim
ln -s /Users/Share/Configuration/.vimrc ~/.vimrc
然后再通过Github创建一个空项目,其自身的帮助文档:
submodule add https://github.com/vim-scripts/UltiSnips.gitched .vim/bundle/ultisnips
git submodule add https://github.com/tomtom/tcomment_vim.git .vim/bundle/tcomment
git submodule add https://github.com/nathanaelkane/vim-indent-guides.git .vim/bundle/indent-guides
git submodule add https://github.com/scrooloose/nerdtree.git .vim/bundle/nerdtree
git submodule add https://github.com/tpope/vim-surround.git .vim/bundle/surround
git submodule add https://github.com/wincent/Command-T.git .vim/bundle/command-t
git submodule add https://github.com/majutsushi/tagbar.git .vim/bundle/tagbar
git submodule add https://github.com/mitechie/pyflakes-pathogen.git .vim/bundle/pyflakes
git submodule add https://github.com/Raimondi/delimitMate.git .vim/bundle/delimitmate
在Git中删除submodule
Delete the relevant line from the .gitmodules file.
Delete the relevant section from .git/config.
Run git rm –cached path_to_submodule (no trailing slash).
Commit and delete the now untracked submodule files.
Git项目初始化的参考
1. 服务器 sudo mkdir MyProject.git cd MyProject.git sudo git --bare init cd .. sudo chown -R git:git MyProject.git 其中 --bare 说明当前init不是工作仓库 2. 客户端 进入项目目录下的.git, git remote add origin git@example.com:my_project.git 然后可以用smartgit 图形化界面Push或者 git add hello.txt git commit hello.txt -m"First commit of new file hello.txt" git push origin master 3. 在服务器端,首次需要从仓库中拷贝出代码 sudo git clone /home/git/FinancialData.git/ FinancialData 然后FinancialData下才可以见到具体的源代码 以后在/FinancialData目录下 sudo git pull就可以获得更新了