#TIL #windows #git #svn 브랜치, revision, commit 존재 여부 확인 방법

C:\> svn info %SVN_URL%/branches/%BRANCH_NAME%
C:\> git ls-remote --exit-code --heads %GIT_URL% %BRANCH_NAME%

브랜치 검사. %errorlevel%을 확인하면 된다.

C:\> svn info %SVN_URL%/trunk -r %SVN_REVISION%
C:\> git cat-file -e %GIT_SHA1%

해당 리비전, 커밋 id가 있는지 검사. 브랜치 검사와 마찬가지로 %errorlevel%을 확인하면 된다. git은 타입이 커밋인지 검사를 추가해야 더 확실해진다. 하지만 빠른 실패를 위한 용도로 쓰기 때문에 여기까지만 검사.

Feedback plz <3 @ohyecloudy, ohyecloudy@gmail.com

A Random Post