깃 (git) 을 사용하여, re we& 관리할 수 있는 대형 프로젝트가 몇 서브 모듈 # 39 의 많은 종속물과의 다른 라이브러리보다는 we& # 39, ve 개발됐다. 각 라이브러리마다 는 별도의 리포 재생하느뇨 꽂으십시오 종속적입니다 프로젝트 비호환성의 서브모두리. 개발 도중, 우리는 종종 그냥 눈 정렬할지 최신 버전의 모든 종속적입니다 서브모두리.
깃 (git) 는 투명지에 내장 명령 이렇게 할 것인가. 그렇지 않으면 할 수 있는 Windows 배치 파일 또는 이와 유사한 어때?
git submodule update --init --recursive
깃 (git) 에 대한 최신 정보를 업데이트 옵션을 추가한 1.8.2 위에 '또는' - 원격 지원 (remote 분기로서의:
git submodule update --recursive --remote
이 모든 " 존중, 비사양 default" 수 있다는 이점도 있다. 분기로서의 이기트모두리스 .git/config 지정된 '' 또는 '' 파일 (경우 일어날 수 있는지, 기본값: 출처 / 사찰안에 여기에 대답을 노력할 뿐만 아니라 다른 몇몇 있는 경우).
깃 (git) 에 대한 1.7.3 이상 사용할 수 있습니다. (단, 아래 정보 수립하였습니다 높여줍니까 어떤 업데이트하십시오 여전히 적용):
git submodule update --recursive
또는:
git pull --recurse-submodules
최신 안티드 가져오기할 스케쳐내 너회의 서브 모듈 커밋한 리포 몇 점.
자세한 내용은 참조 git 서브모두리 (1)
git pull --recurse-submodules --jobs=10
>. 배운 1.8.5. 깃 (git) 의 첫 번째 기능
처음 실행할 필요가 있습니다
>. git 서브모두리 업데이트 - 초기화 - 반복
git submodule update --init --recursive
깃 (git) 내에서 리포 디렉터리인 최상의 for me.
이렇게 하면 모든 최신값 당기십시오 서브 모듈 등.
git - the base command to perform any git command
submodule - Inspects, updates and manages submodules.
update - Update the registered submodules to match what the superproject
expects by cloning missing submodules and updating the working tree of the
submodules. The "updating" can be done in several ways depending on command
line options and the value of submodule.<name>.update configuration variable.
--init without the explicit init step if you do not intend to customize
any submodule locations.
--recursive is specified, this command will recurse into the registered
submodules, and update any nested submodules within.
_
git submodule update --recursive
깃 (git) 내에서 리포 디렉터리인 최상의 for me.
이렇게 하면 모든 최신값 당기십시오 서브 모듈 등.
우리가 사용하는 이. # 39 라는 git 새끼 it& '의':
#!/bin/bash
# Exists to fully update the git repo that you are sitting in...
git pull && git submodule init && git submodule update && git submodule status
그냥 적당한 bin 디렉토리에 넣어 (/ usr / local / bin). 만약 Windows 의 구문을 이해했소 사용할 수 있도록 수정해야 할 수 있습니다:)
이에 따라 원래 작성자 주석문입니다 대한 모든 머리를 잡아 모든 서브 모듈, 즉 좋은 질문이네요.
나는 이에 대한 명령 '예쁜' 깃 없는 내부적으로 합니다. 이렇게 하려면 어떤 헤드입니다 상행담관염이라고 대한 보고서인지 서브모두리 파악해야 하는 것입니다. 단순할 수 있는 '마스터' 는 말이 가장 최신임 분기로의, etc.
이 같은 간단한 스크립트입니다 만드시겠습니까 산아래의 다음과 같다.
즉, 어떤 점에서는, 함께 한 것이 아니라, 더 자동으로 설명됨 스크립트입니다 너희는너희가 총력을 기울이고 있다. 주의가 필요합니다!
윈도 플랫폼을 사용하고 있는 경우에는, 파이썬 스크립트를 사용하여 구현할 수 있기 때문에 할 수 있습니다 바라볼 수 있는 매우 이들 지역에서는. 그럼 그냥 배시 / linux, unix 의 경우 제안하세요 스크립트입니다.
필요한 설명? 그냥 게시물로의 셀명.
헨리크 켜있을 right track. # 39, & # 39 는 foreach&. 임의의 셸 스크립트 명령을 실행할 수 있다. 두 가지 옵션, 가장 최신의 가져오기할 수도 있습니다.
git submodule foreach git pull origin master
그리고,
git submodule foreach /path/to/some/cool/script.sh
git submodule init
git submodule update
git submodule foreach 'git fetch origin; git checkout $(git rev-parse --abbrev-ref HEAD); git reset --hard origin/$(git rev-parse --abbrev-ref HEAD); git submodule update --recursive; git clean -dfx'
당시 최신 버전 정보를 지적했다 (대표 필프리오 ) 가 필요합니다. 할 수 있는지 네스트된 서브 모듈 자사의 최신 버전:
git submodule foreach --recursive git pull
-Outdated below- 주석문입니다.
이 방법은 isn& 공식 # 39, t do it?
git submodule update --init
내가 사용하는 때마다. 아무 문제 없이 부진했다.
그냥 것으로 사용할 수 있습니다.
git submodule foreach --recursive git submodule update --init
또한 모든 서브 모듈 반복적으로 하는 것, 즉 당기십시오 의존성.
클론할 및 Init 서브모두리
git clone [email protected]:speedovation/kiwi-resources.git resources
git submodule init
개발 도중 그냥 당기십시오 서브모두리 및 업데이트하려면
git pull --recurse-submodules && git submodule update --recursive
git submodule foreach git pull origin master
git submodule update --remote --merge
하지만, 위의 대답이 优秀 git 후크 사용한 간소화하는지 하지만 알고보니 그 2.14 만들기 위해 이 git 설정할 수 있습니다 (['git 구성용 서브모두르드러커스'] https://git-scm.com/docs/git-config # git 구성용 서브모덜레커스) 를 true 로 서브 모듈 활성화하십시오 업데이트하려면 데이터베이스에구성원을 git 리포지토리를 당기십시오 있습니다.
이 경우 모든 서브 모듈 억제하는 부작용이 있을 수 있습니다 하지만 그들이 오른길로 분기로서의 변경하십시오 필요로 하고 있는 행동을 할 수 있지만 이 경우 이미 작업.
사용하여 수행할 수 있습니다.
git config submodule.recurse true
상위 레벨에서 config. 리포:
git submodule foreach git checkout develop
git submodule foreach git pull
이렇게 하면 모든 분기로서의 스위치 개발 및 당기십시오 최신값
통합 it with a 깃 (git) ' [앨리어스가]'.
모피쳐 사업은 '의 경우 이 같은 일이 이기트모두리스':
[submodule "opt/submodules/solarized"]
path = opt/submodules/solarized
url = [email protected]:altercation/solarized.git
[submodule "opt/submodules/intellij-colors-solarized"]
path = opt/submodules/intellij-colors-solarized
url = [email protected]:jkaving/intellij-colors-solarized.git
이 같은 일이 이기트콘피그 내에 추가
[alias]
updatesubs = "!sh -c \"git submodule init && git submodule update && git submodule status\" "
다음 서브 모듈 업데이트하려면 실행하십시오:
git updatesubs
다음은 당신의 모든 git 에서 가져오기할 명령줄이 표시할지를 리포지토리를 they& # 39, re 방관하겠나 서브 모듈:
ROOT=$(git rev-parse --show-toplevel 2> /dev/null)
find "$ROOT" -name .git -type d -execdir git pull -v ';'
깃 (git) 에서 이를 실행할 경우, '에 $ root" " 리포지토리를 최우선 굈', '.' 수 있습니다.
발언. 하지만 너무 쉬운 방법이 없는 고유한 작업 또한 장점.
'헤드' 만 '할 경우 클로닝에만 해당 버전을 리포지토리와 헤드입니다 모두의 그 서브 모듈 (즉, 체크 아웃하려면 trunk" ";), 그리고 1 정보정의다음 루아 스크립트를 사용할 수 있습니다. 깃 (git) - - - - - 원격 초기화 업데이트하십시오 간단한 명령을 서브모두리 가끔 '반복' 페치할 없습니다. 복구할 수 없는 '깃 (git) = 1 세로 발생할 수 있습니다' 오류:. 이 경우 한 클린업합니다 서브디렉토리에 서브모두리 클론할 디렉토리이며 .git/modules '하는' - '클론' 깃 (git) 을 사용하여 수동으로 깃 (git) dir 별도의 함장님이요 , Uirl 길을 찾을 수 있는 유일한 복잡성의 아웃해야 '에서' 디렉터리이고 이기트 서브모두리 및 경로를 서브모두리 슈퍼프로젝트 진단트리
발언. 'https://github.com/boostorg/boost.git' 리포지토리를 스크립트입니다 어하여 테스트되었습니다 불과하다. 그 특성에: 모든 서브 모듈 및 '만' map_layer 호스팅된 동일한 호스트상의 이기트모두리스 URL 상대치 *.
-- mkdir boost ; cd boost ; lua ../git-submodules-clone-HEAD.lua https://github.com/boostorg/boost.git .
local module_url = arg[1] or 'https://github.com/boostorg/boost.git'
local module = arg[2] or module_url:match('.+/([_%d%a]+)%.git')
local branch = arg[3] or 'master'
function execute(command)
print('# ' .. command)
return os.execute(command)
end
-- execute('rm -rf ' .. module)
if not execute('git clone --single-branch --branch master --depth=1 ' .. module_url .. ' ' .. module) then
io.stderr:write('can\'t clone repository from ' .. module_url .. ' to ' .. module .. '\n')
return 1
end
-- cd $module ; git submodule update --init --recursive --remote --no-fetch --depth=1
execute('mkdir -p ' .. module .. '/.git/modules')
assert(io.input(module .. '/.gitmodules'))
local lines = {}
for line in io.lines() do
table.insert(lines, line)
end
local submodule
local path
local submodule_url
for _, line in ipairs(lines) do
local submodule_ = line:match('^%[submodule %"([_%d%a]-)%"%]$')
if submodule_ then
submodule = submodule_
path = nil
submodule_url = nil
else
local path_ = line:match('^%s*path = (.+)$')
if path_ then
path = path_
else
submodule_url = line:match('^%s*url = (.+)$')
end
if submodule and path and submodule_url then
-- execute('rm -rf ' .. path)
local git_dir = module .. '/.git/modules/' .. path:match('^.-/(.+)$')
-- execute('rm -rf ' .. git_dir)
execute('mkdir -p $(dirname "' .. git_dir .. '")')
if not execute('git clone --depth=1 --single-branch --branch=' .. branch .. ' --separate-git-dir ' .. git_dir .. ' ' .. module_url .. '/' .. submodule_url .. ' ' .. module .. '/' .. path) then
io.stderr:write('can\'t clone submodule ' .. submodule .. '\n')
return 1
end
path = nil
submodule_url = nil
end
end
end