简体   繁体   中英

integration between google colab and github

I am working in google colab with an ipython notebook which I "opened" using the link from github (the notebook is uploaded to Github). Then, in the body of notebook I cloned the repository to have an access to a library from a repository. I want to modify this library occasionaly, eg write a new function. I noticed that even though I can view the code for the files in this library, and even modify the code of this library in colab, eg write a new function, I can't import this function in my ipython notebook. What is the best way to solve this problem?

I tried to modify the library on my local computer, then upload these files to github. But when I try to pull the files from the repository on ipython notebook on colab using !git pull origin master it says that all files are already up to date. Even a new added function is present in a library in colab - I still cannot import the function.

I also tried to close and "open" again this notebook in colab using the github link (to be able to run a cell with !git clone again - I deleted these files from the notebook in colab using %rm -rf beforehand). Colab still doesn't see the function defined in github.

I'm new to git and colab. Please, help.

first point out to the location in drive as

%cd /content/drive/My Drive/dir1

then clone the directory you want, eg,

!git clone https://github.com/KaiDMML/FakeNewsNet

on refreshing the drive, you will find the cloned directory in the drive.

Remember to connect to the drive first before all these steps在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM