[개발] 이야기

python에서 git pull 하기

헤이나우 2020. 9. 5. 08:33
반응형

가끔 쥬피터 Remote환경이나 원격 Pull을 하기위해서 (원격컴퓨터)

Python환경에서 Git Pull을 해야하는 경우가 있다.

우선 gitpython을 설치후 아래 코드를 입력해준다.

 

pip 설치

pip install gitpython

 

GIt Pull

import git  
git\_dir = '{Pull Path}'  
repo = git.Repo(git\_dir)  
repo.remotes.origin.pull()  

아주 간단하지만 유용하게 사용됩니다.~!

반응형