Import an .ipynb file or create a new notebook on Google Colab.
In the upper-left corner menu, go to File -> Save a copy in Github...
You'll be asked to authenticate on GitHub.
Select the Repository as
your-username/beam and the Branch you're working on, not master!
Set the file path to somewhere inside
You can leave the commit message as the default value, we'll squash all the commits into a single one at the end anyways.
Make sure the Include a link to Colaboratory is checked.
Pull the latest changes from the remote branch.
If you have made local changes to the files, you can checkout them to discard the changes and pull the latest ones.
git checkout -- file1 file2 .. fileN git pull
Repeat for all the notebooks you want to add.
From the project root directory, patch the Notebooks to point to the
master branch instead of the local branch.
Squash all the commits into a single commit.
git commit --all --amend
After this check the commit hash of the first (bottom) commit you want to include.
Knowing the commit hash, we'll now rebase to that commit.
git rebase -i <commit-hash>
Your editor will open. Leave the first commit as
pick and the rest replace them as
squash. Don't worry about the commit messages for now.
pick 55ed426e22 commit message 1 s 0cbabbf704 commit message 2 s d1513977fc commit message 3 s 17c6db7950 commit message 4 s 81634761e9 commit message 5
NOTE: in vim you can do this with
Finally, your editor will open again. All the commit messages will be visible, delete and reword as necessary to leave only one uncommented commit message. After closing your editor all your commits should be squashed :)