Methods for using Git with Google Colab

前端 未结 12 793
臣服心动
臣服心动 2020-12-12 11:42

Are there any recommended methods to integrate git with colab?

For example, is it possible to work off code from google source repositories or the likes?

Nei

12条回答
  •  离开以前
    2020-12-12 11:53

    In order to protect your account username and password, you can use getPass and concatenate them in the shell command:

    from getpass import getpass
    import os
    
    user = getpass('BitBucket user')
    password = getpass('BitBucket password')
    os.environ['BITBUCKET_AUTH'] = user + ':' + password
    
    !git clone https://$BITBUCKET_AUTH@bitbucket.org/{user}/repository.git
    

提交回复
热议问题