As you all know we are able to load a file from a site such as Kaggle and GitHub to Google Collab, we apply the bellow code to download from other sites into Google Collab:
wget nlp.stanford.edu/data/glove.6B.zip
but I am very curious to know if I am able to upload a saved file in Google Collab to another site through some commands like the above? I mean I can do it manually in some multiple steps but please let me know if there are some commands to upload a file directly from Google Collab into another site such as GitHub.
Best Answer
To add a file to a Git repository and upload it to GitHub please refer to its official help articles Creating a new repository, Cloning a repository, and Adding a file to a repository using the command line. I’ll include the most important steps below:
Install Git:
Create a repository on GitHub.
Import (or “clone”) the Git repository and enter its top directory:
Place the desired file into the repository directory (or one of its sub-directories) e. g. by moving or copying it from another place or downloading it from an external resource.
Add the file to the Git repository:
Commit the changes to the repository:
Upload (or “push”) the committed changes to the upstream repository (here: at GitHub):
Obviously you don’t need to repeat steps 1–3 if you did them before.