Syncing GitHub from Jupyter Notebook refers to the process of keeping your Jupyter Notebook files up-to-date with a remote GitHub repository. This allows you to collaborate on Jupyter Notebooks with others, track changes to your notebooks over time, and easily share your work with others.
Here are the basic steps involved in syncing GitHub from Jupyter Notebook:
- Open Terminal in the docker instance
- Install Git in the docker using below commands:
- apt-get -y update
- apt update
- apt install git
- git –version
- Setting the user in the config file:
- git config –global user.name <USER NAME>
- git config –global user.email <useremail>
- Check entries in the Config file:
- git config –list
- Create a GitHub repository: If you don’t already have a GitHub repository for your project, you’ll need to create one. This will be the remote repository where you’ll store your Jupyter Notebook files.
- Clone the repository: Clone the remote repository to your local computer. This will create a local copy of the repository on your computer.
- git clone https://github.com/<repository>
- Connect Jupyter Notebook to the repository: Open Jupyter Notebook and navigate to the directory where you cloned the repository.
- Make changes to your notebooks: Once connected, you can make changes to your Jupyter Notebook files as usual. Jupyter Notebook will automatically track these changes.
- Add files / folder to git:
- Add Folder: git add <folder>
- Add files:
- git add *.csv
- git add *.ipynb
- git add *.txt
- Check Status:
- git status
- Commit the changes:
- git commit -m “Commit Initial Version”
- Generate Personal Access Token (PAT): If you have not generate personal access token, use below steps to generate the PAT:
- Login to GitHub
- Navigate to “Profile -> Settings -> Developer Settings -> Personal Access Tokens -> Tokens(Classic)”
- Click “Generate new token”
- Select appropriate options in the “Generate new token” window and click on Generate
- Save the token for future use
- Push changes: When you’re ready to share your changes, you’ll need to push them to the remote repository. This will upload your changes to GitHub and make them available to others.
- git push -u origin main
- Enter username of GitHub
- Under password field, enter copied personal access token (PAT) and click on Enter. This will sync files to GitHub
Syncing GitHub from Jupyter Notebook is a great way to collaborate on Jupyter Notebooks and keep your work organized. With a little practice, you’ll be able to sync your notebooks quickly and easily.
Hey people!!!!!
Good mood and good luck to everyone!!!!!