git bare 저장소 생성및 remote push
git bare 저장소 생성및 remote 푸시
1. git bare 저장소생성
git서버 $> mkdir test.git
git서버 $> cd test.git
git서버 $> git init --bare
* 추가작업 (git remote 주소 간단하게)
- git remote 주소 : gituser@서버주소:/user/gituser/test.git
- git서버 root $> ln -s /user/gituser/test.git /test.git
- 간편화된 git remote 주소 : gituser@서버주소:/test.git
2. 작업서버 init
작업서버 $> git init
작업서버 $> git add .
작업서버 $> git commit -m 'first commit'
3. 작업서버 remote 저장소지정 및 원격저장소로 push
작업서버 $> git remote add origin gituser@서버주소:/test.git
작업서버 $> git push origin master
4 기타 다른서버에서 원격저장소 clone
다른작업서버 $> git clone gituser@서버주소:/test.git
5. 이후 알아서 브랜치관리
* 기타참고링크
- https://rogerdudler.github.io/git-guide/index.ko.html
- http://backlogtool.com/git-guide/kr/
* 기타 vendor 디렉터리내에 .git 이있어서 vendor 내용은 커밋에 포함안될때.
https://github.com/composer/composer/issues/2506
https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md
- vendor 의 .git 와 .gitignore 를 제거후 커밋.(좋은방법은 아닌듯)
find vendor/ -type d -name .git -exec rm -rf {} \;
find vendor/ -name .gitignore -exec rm {} \;
git rm -r --cached vendor
git add .
git status
git commit -m "Add vendor tracking "
git push