Step-by-Step Guide to Fix Common GitHub Problems

Following are some of the issues I got along the way when setting up git and Jupyter. I've sometimes spent hours looking for solutions when the issues are quite simple and got simple answers. I'm recording these here so that you don’t have to waste time looking for answers.

1️⃣ Navigating to folders with spaces in the name

Solution:

In [ ]:

cd "Add your folder name within double quotations"

2️⃣ Opening Jupyter Notebook

Solution: Here the issue is I was trying to execute the command in the python shell. Instead run the command in the regualr cmd.

3️⃣ ! [rejected] main -> main (fetch first)
The above error when trying to push changes to the main. This error happens because your GitHub repo has new changes that your local repo doesn't have. You need to pull the latest changes before pushing.

Solution:

#Fetch the latest changes from GitHub
git pull origin main --rebase 

#Then push your changes again
git push origin main

After pushing changes to GitHub, you might still want to make changes in your Jupyter notebook. Once I've saved the changes and tried to push it again with 'git push origin main' command, the cmd says everything is up to date.

In this case I had to manually add the files again.

Solution:

In [ ]:

git add -A
git commit -m "Manually adding all changes"
git push origin main