anderkve / FYS3150

https://anderkve.github.io/FYS3150
26 stars 14 forks source link

Adding a Github token #4

Closed nevlunghavn closed 3 years ago

nevlunghavn commented 3 years ago

Not having much luck with this. It looks like this is no longer optional on github, so we have to get it working. I've tried:

  1. following the instructions for linux at https://anderkve.github.io/FYS3150/book/using_git/setting_up_git_and_a_GitHub_repo.html with no luck. Generating the token went well, running the command "git config --global credential.helper store" returned no output (no error or anything else). Running command, "git pull" just returns, "Already up to date." in the repo which I've already cloned. At no point am I prompted for my github user name. My fys3150 repo is public, so I would not expect to be asked for a username either.

Any help would be appropriated.

reneaas commented 3 years ago

Hi, try the following:

  1. Create a non-empty .txt file by running:
echo "This is a line" > tmp.txt
  1. Call credential.helper again:
git config --global credential.helper store
  1. Add, commit and push the changes:
git add --all && git commit -m "added a dummy file to add token" && git push

Once you run the last command, git will require authentication. Type in your github username and paste in your token as a replacement for a password.

This should fix the problem.

nevlunghavn commented 3 years ago

That did the trick. Thanks very much @reneaas