How to simultaneously keep git repository up to date and back up my own files?


(David Bressler) #1

I’m still fairly new to git, so please excuse if this is a simple question.

I want to keep my repo up to date by doing git pull from the main repo at https://github.com/fastai/fastai.git

However, as I’m working, I’m also creating my own files that I’d like to back up on github.

Is there any way to keep my repo up to date by occasionally pulling from the main repo, but also backing up the files I create to github?

Thanks!


#2

If you are working on the course notebooks, the best solution is before you make any changes to the file, make a copy of it (you can do so from inside the notebook by going to file > make a copy.

You should then still be able to pull from fastai easily (there should be no conflicts).

If you edit any other files in the library (apart from the jupyter notebooks), then things become tricky. Adding new files is okay but editing the ones that are there might cause trouble should they be edited upstream (in the fastai repo).

If you would like to also backup the work that you do on the notbooks that you create, you could have a new remote set up for saving your work but that gets tricky. The best solution might be to just keep your notebooks in a seperate folder, outside of the fastai repo.

If, on the other hand you are planning on making changes to the library itself while still maintaining the ability to pull updates, than I am afraid there is no easy workflow - there will be conflicts you will encounter. You probably should create a separate branch and be rebasing it regularly on top of master but that requires some extra experimentation and reading. The terms you are looking for here are forking and keeping your repository up to date with upstream.


(David Bressler) #3

Hey thanks a lot.

Based on your suggestion I’ll just create a separate git repo for my own files… seems like the easiest solution.