Jupyter Notebook file is taking forever to upload on Github - github

I was trying to upload one of my Jupyter Notebook files on GitHub, but it's taking forever to upload.
File size is also not that big. It's about 17KB. Also getting problem for this notebook only.
Here's the screen shot.
Any kind of help or suggestions are highly appreciated.

Try using Git Bash to push your code/make changes instead of uploading files directly on GitHub (it is less prone to errors and is quite comfortable at times - takes less time as well!), for doing so, you may follow the below-given steps:
Download and install the latest version of Git Bash from here - https://git-scm.com/
Right-click on any desired location on your system.
Click “Git Bash Here”.
git config --global user.name “your name”
git config --global user.email “your email”
Go back to your GitHub account – open your project – click on “clone” – copy HTTPS
link.
git clone PASTE HTTPS LINK.
Clone of your GitHub project will be created on your computer location.
Open the folder and paste your content.
Make sure content is not empty
Right-click inside the cloned folder where you have pasted your content.
Click “Git Bash Here” again.
You will find (master) appearing after your location address.
git add .
Try git status to check if all your changes are marked in green.
git commit --m “Some message”
git push origin master
Hope this helps! Good luck!

You could try and:
clone the repository, add the file locally, commit and push
check on github.com if your remote repository has a .gitattributes file with lfs directives in it.
Maybe that repository, managed by LFS, has reached some upload limit which would prevent any new upload.

Related

Why is it appearing like I have pushed my code to github but I got to my profile and the code is not there?

What am I doing wrong?
Why will my code not show on github even though it appears to have pushed saying clean tree.
What am I supposed to be entering when it asks for git credentials osxkeychain?
Hello I have been watching video after video and reading the documentation on github and how to use it but nothing seems to be working. I have created a repo in my account and done the following:
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/stephBrandon/PythonNumberGuessingGame.git
git push -u origin main
it responded by saying initialized empty git repo in my folder which is true when hitting ls -a there is a .git file and there is a readme now as well
But when checking on my github none of the code it there and in the terminal it seems to be trying to access my old git hub account instead of my new one and I have no idea what to do now.
remote: Permission to stephBrandon/PythonNumberGuessingGame.git denied to stephanieBrandon.
fatal: unable to access 'https://github.com/stephBrandon/PythonNumberGuessingGame.git/': The requested URL returned error: 403```
I had issues with the keycode and went into my key chain to see if I could change it there or if I was entering the wrong password but the one I had I deleted and it wont allow me to add another like some other videos I have watched.
Please help. I just want to know how to start using GitHub as I am in year 2 of my program and want to have a visible portfolio of my work without the frustrations of not figuring out how to use GitHub and it always seeming to take longer to upload to GitHub then the projects themselves sometimes.
If I am missing something in my explanation above here is a copy of the terminal
```(base) stephaniebrandon#Stephanies-MacBook-Pro-2 Lab4Random % git commit -m "First commit for Python Guessing Game"
[main e955053] First commit for Python Guessing Game
1 file changed, 44 insertions(+)
create mode 100644 lab4.py
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 Lab4Random % git remote add origin https://github.com/stephBrandon/PythonNumberGuessingGame.git
error: remote origin already exists.
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 Lab4Random % git remote add origin https://github.com/stephBrandon/PythonNumberGuessingGame.git
git branch -M main
git push -u origin main
error: remote origin already exists.
remote: Permission to stephBrandon/PythonNumberGuessingGame.git denied to stephanieBrandon.
fatal: unable to access 'https://github.com/stephBrandon/PythonNumberGuessingGame.git/': The requested URL returned error: 403
(base) stephaniebrandon#Stephanies-MacBook-Pro-2 Lab4Random % ls -a
. .. .git README.md lab4.py```
Additionally, when I try to do
```git push -u origin main```
it doesn't do anything but enter a loop that I have to control c to get out of.
If you are okay with using SSH instead of HTML, this should be the easiest way. This is assuming you have not local .git folder (you can delete it if you don't have git history you'd like to save).
Part 1: Set up SSH with GitHub
First, open your terminal and run this command:
ssh-keygen -b 4096 -t rsa
When it asks you for a file name and save location, just hit ENTER to use defaults. Unless you feel it is necessary you can skip the password requirement the same way.
This will create a new (hidden!) folder named .ssh and two files in it: id_rsa and id_rsa.pub. id_rsa.pub is your public key. This is how you will authenticate with GitHub. Never share your private key (the other file).
Now, go to GitHub and sign in normally. Then, go to your profile settings (pictured below).
Then to this setting...
And hit this green button:
Give it any title you'd like, such as the name of your computer, and paste in the contents of your id_rsa.pub file into the box and hit "Add SSH key". You should be able to open either of the two rsa_id files with any text program.
Part 2: Setting up a Repo
In my experience, the easiest way to get Git configured correctly is to do this method rather than setting the upstream yourself.
First, make a new repository on GitHub. It doesn't matter if it's private or public, but add at least one file (such as a readme or .gitignore) to generate the first commit.
Now, you should be directed to your new repo. If you get a weird screen telling you to run some commands you likely didn't add any files when setting up the repo.
Assuming that you see the page, however, click the "code" button on the top right and select SSH. Copy it to the clipboard. (pictured below)
Part 3: Setting up your local repo
Open your terminal of choice and run
git clone git#github.com:[your details here].git
It should clone the repo and set the upstream for you. If you get an error here you likely have issues with your SSH settings.
Once you have the repo cloned, drag in any project you'd like and treat it like normal!
git status
git add *
git commit -m "Your message"
git push
Hope that works for you! Let me know if you have any problems.

VS Code github keeps showing Uploading files forever

The message keeps saying uploading files "forever". What I did was created a folder with a file inside. On Github, the repository was created successfully but the file is not uploading. And yes I have installed git.
The repository created successfully but the files are not uploading.
If you have the latest Git for Windows, chances are you have a git config credential.helper set to manager-core.
As I mentioned in "After $git push -u origin main command, Git bash is not requesting any authentication literally does nothing", the same issue is seen in command-line, not just VSCode.
This is because of the Git-Credential-Manager-Core (interface to the Windows Credential Manager, in charge of caching your credentials: GitHub username/token).
Try and install the last GCM-Core (released yesterday), and see if the issue persists then.
Or, alternatively, you could use an SSH URL, again, to see if the issue persists.
What fixed it for me:
In VSCode: File -> Preferences -> Settings.
Filter for "git".
Select "git (80)" on the left pane.
Uncheck this:
Git: Require Git User Config
Controls whether to require explicit Git user configuration or allow Git to guess if missing

Creating new git repository, can't add directory

I am about to throw my laptop through a wall, and am hoping for help before reaching that point. For reference, I am following these instructions exactly - https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/.
I have a directory ".../path/thisdir". Inside of thisdir are (1) a file called Demo.R and (2) a directory called sportVU. sportVU is a directory with ~15 files in it.
When I follow the instructions in that link, my github repo looks like this:
https://github.com/NicholasCanova/packageSportVU
Notice that the sportVU directory link cannot be clicked in github, and when I download the repo, sportVU is an empty folder. Why is this happening? This shouldn't be so tough.
EDIT: this is what the repo looks like in my local machine, I'm 100% sure it's not empty:
It could be that you have two .git folder in your directory. View hidden folders to see.
Similar questions:
What does a grey icon in remote GitHub mean
Why can I not open my folder in GitHub?
Since Git doesn't store empty folders the steps you should follow exactly are:
Delete the old repo and start again following exactly my steps.
git clone <repo url>
Inside the folder of the cloned repo create a directory manually and name it as you want i.e sportVU.
Drag and Drop all the files you want in the sportVU direcrory.
cd to Myrepo/sportVU and type git add *
type git commit -m "added some files"
git push -u origin master.
and you should be all set

Rstudio: Changing origin for git version control of project

I originally set up git in Rstudio while enrolled in the Data Scientist's Toolbox course at Coursera. Unfortunately, I did this in my phd project. The repository no longer exists on github. I am now attempting to write my thesis in rmarkdown using knitr and bookdown. I would like to use version control, both to learn proper git workflow and to have a structured back up of everything I have done in my thesis. However, I have been unable to change the version control repository in Rstudio.
I am unable to change this in the Tools > Version control > Project setup > Git/SVN menu. The Origin: textbox is unchangable.
I tried creating a new project using the old phd project's working directory. This also cloned the version control settings.
How do I change the origin to accomplish what is described above?
Git, Github and Rstudio are different things. You could use git as local version control tools. You might connect your local repo to Github account which is based on git by push/pull. Rstudio just makes a user interface for git and supplies the function to push the repo into remote server based on git to make version control(not only Github, but also Gitlab).
So for your issue, if you do not want to pay for github for a private repo, all of your code would be public and I don't think it is good before your finally finished your thesis. But version control could be made locally with git only. Just use git shell to control the version.
However, as a student, github could support private repo here for you. Just register and find your student package. Then just remove the url for remote repo after you cd to your workdir in command line, use the following code to find your remote url(mostly you might fing origin):
git remote -v
Then use this to remove them:
git remote rm origin
Now you could use version control locally. If you want to connect this repo to your remote github private repo, use this:
git remote add origin https://github.com/[YourUsername]/[YourRepoName].git
RStudio would find this information about git and support your following operation. Project in RStudio is different with git, although project support git as version control tool. So you need git in command line or shell to solve your problem.
This can be done by opening /your.project/.git/config
and editing the remote origin line(s), e.g. changing from git to https.
Restart Rstudio & you'll be prompted for your github username & password.
This is what worked for me for migrating from github to Azure
Go to the top right Git window in RStudio and click on the gear. Now click Shell (to open the terminal there).
#remove origin
git remote rm origin
#add new origin like Azure for me via HTTPS
git remote add origin https://USER#dev.azure.com/USER/PROJECT/_git/REPONAME
#push your local repro
git push -u origin --all
#in my case put in the PAT password if you needed to generate one.
After testing, I found some clue
Actually Rstudio is not really smart about this setting
It will first search for the git file in the Rproject folder where your Rporject file is located
if it could not, then it goes up to the folder contains your Rproject folder
However, for version control you only need coding files while RProject may contains some big files like .RData some pictures etc.
I don't find a way to manually disrupt this logic flow, the only thing you can do is to delete the current git repository setting files(which is .git folder and 2 other git setting files), then Rstudio may ask you if you want to init a new one.

How to check out a project from a server with Git

You may classify my question to the layman's level, but I am using Git for the first time (til now I used TortoiseSVN) and I am not sure how I can check out an existing project from a server, so as to have it available on my local machine in a folder. I have installed Git Bash. Should I run it (Gui), select New Archiv and then specify the path of the project in the server? Is there a better Git framework to install, which is appropriate to make the same task more easily?
I would appreciate also some screenshots if needed in the answers.
Update: I have installed also TortoiseGit. I want to create a new clone by a right click in a directory, but the new Clone is not available after the right click. Does it need additional configuration? If no, what should I do from TortoiseGit to checkout an existing project?
I'd usually recommend learning git from command line. But if you are already familiar with TortoiseSVN then TortoiseGIT is a good tool for you.
Also, I think you should learn git very well. I can recommend the book Pro Git.
To "check out" a git repository is called clone in the git world (you will get a whole copy of the server repository). This can be done either from command line or TortoiseGIT.
git bash:
$ cd /path/to/my/projects
$ git clone url-to-server-repo
Update:
Since you get the "normal" TortoiseGit menu (without clone option), it seems you already have a local git repository. You probably created an empty git repository by mistake. Look for a hidden directory .git in the project directory or any parent directory.
right click on the folder (not right click on nothing in the folder, the icon of the folder you want to clone INTO from the parent directory) and select clone from the menu.
FYI:
clone = create a copy of a repository.
checkout = change the current state of an existing repo to a saved state.
so if you have a repo w/ 3 commits (A,B,C) when you clone the repo you will be at the most current state (C). if you want to see the previous state of the repo you would git checkout B. if you want to see the repo's initial state you would git checkout A
hope that helps.