| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- 엔데버
- Cox
- 42헤더
- google photo
- 마인크래프트
- 42Header
- 영상 나누기
- 구글 포토
- chmod
- APS-C
- 오라클클라우드
- SH권한부족
- 구글포토
- 하이시에라 도커
- git
- 다른저장소파일
- 쌍따옴표
- insta360
- APSC
- 엠프리스
- calc
- GooglePhoto
- 360도 영상
- 마인크래프트서버
- vue
- High Sierra Docker Desktop
- 베드락
- 인스타360
- submodule
- ffmpeg
Archives
- Today
- Total
개발하다 정리해보자
다른 저장소의 파일을 그대로 가져와서 사용하는 법 본문
깃을 사용하면서 다른 저장소에 있는 파일을 그대로 나의 프로젝트에 사용하고 싶은 일이 있었다.
이런 경우에는 submodule과 심볼릭 링크를 사용하면 되었다.
$ git submodule add https://github.com/hijae/open-fuji-recipes-profiles
$ ln -s hijae/open-fuji-recipes-profiles/makeFP.py
$ git add .gitmodules makeFP.py
$ git commit -m "add a symbolic link to makeFP.py with the respective submodule"
위와 같이 git에 서브모듈을 설정하고 원하는 파일을 심볼릭 링크로 지정한 후 커밋하면 된다.
혹시나 클론을 받아왔을때 동작하지 않으면 서브모듈을 업데이트 하면 해결된다.
$ git submodule init && git submodule update
git: symlink/reference to a file in an external repository
Is it possible in git to have a "link" to a particular file in a git repo? Like what git submodules do for folders but my question is about a particular file, not a full directory: my-project/
stackoverflow.com
'개발' 카테고리의 다른 글
| 스크립트는 실행하기 전에 반드시 권한을 주자 (0) | 2023.02.23 |
|---|