Support for password authentication was removed on August 13, 2021. Please use a personal access token instead – Fix for Mac

Hey everyone,

If you’re like me and a bit slack with your personal projects you might’ve started receiving the following error today:

admin@Admins-iMac ui % git push
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/Buzzology/referrer.git/': The requested URL returned error: 403

As the message says, Github wants you to start using a Personal Access Token (PAT) instead of password authentication. Luckily, the fix is pretty straight forward – you’ll need to create a Personal Access Token and then update your keychain.

Step #1: Create a Personal Access Token (PAT)

To create the personal access token, login to Github and go to the following page: https://github.com/settings/tokens

You can also get to this page via the following:

  1. Click on your profile dropdown
  2. Click settings
  3. Click Develop Settings (on the left)
  4. Click Personal access tokens (on the left)

Once you’re on the Personal Access Tokens page you should see something like the following:

Click the Generate new token button, set an expiry and then copy the generated value (you’ll need it in the next step).

Step #2: Updating your keychain

Now that you’ve got your Personal Access Token you need to replace the password that you’ve currently got stored in your keychain. To start, open search and bring up Keychain Access:

If you’ve got quite a few keys there you can filter them by searching for github. You’ll then need to double click on each of the entries and replace the stored password with your personal access token:

Note that you’ll first need to click Show Password.

Now that your keychain is updated, close and then re-open any of your terminals and you should be good to go.

admin@Admins-iMac ui % git push
Enumerating objects: 110, done.
Counting objects: 100% (110/110), done.
Delta compression using up to 4 threads
Compressing objects: 100% (91/91), done.
Writing objects: 100% (93/93), 15.30 KiB | 2.19 MiB/s, done.
Total 93 (delta 64), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (64/64), completed with 14 local objects.
To https://github.com/Buzzology/referrer.git
   0d2ecf0..97f2716  master -> master
admin@Admins-iMac ui % 

Thanks to the following Stackoverflow post for the additional info: https://stackoverflow.com/a/67650257/522859

Git Ignore Template for .NET

Hi everyone,

A sample .gitignore file for if you’re working with .net:

*.cache
*.dll
*.exe
*.pdb
/build/
*.suo
*.user
_ReSharper.*/
*.sdf
*.opensdf
*.tlog
*.log
TestResult.xml
*.VisualState.xml
Version.cs
Version.h
Version.cpp

Also, if you happen to have added some files you didn’t mean to:

git rm –cached file_you_dont_want.pdb
git commit -m “Remove pdb file”

Thanks to these stackoverflow posts for the info:
https://stackoverflow.com/a/8675415/522859
https://stackoverflow.com/a/11629271/522859

Import an Existing Project to BitBucket

Hi everyone,

Today I needed to import an existing project to Bitbucket. The documentation is really good, but just in case you have trouble finding it:

  1. Navigate to the root directory of your project.
  2. Run the following commands in terminal/command prompt:
    git init
    git add –all
    git commit -m “Initial Commit”
  3. Login to Bitbucket and create repository.
  4. Locate the clone URL (left menu) e.g. https://email_address.bitbucket.domain:7999/project_name/repo.git
  5. Upload your files:
    git remote add origin https://email_address.bitbucket.domain:7999/project_name/repo.git
    git push -u origin master

    Check out the following link for more info: https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html

Assets:Precompile (Rake Aborted) – Heroku

Hey everyone,

I ran into the following error over the weekend while trying to push to heroku:

Running: rake assets:precompile
rake aborted!
could not connect to server: Connection refused
Is the server running on host “127.0.0.1” and accepting
TCP/IP connections on port 5432?

This stackoverflow post helped to solve the issue. All you need to do is add the following line to your application.rb file:

#Applicication.rb
config.assets.initialize_on_precompile = false

Let me know if you have any problems.

Git with KDiff3 – Windows

Hey all,

Just a quick post showing the config I needed to use in order to get KDiff3 working with git. It took a while to get this working so hopefully it’ll be able to help someone else out.

#Config file
[user]
	email = test@test.com.au
	name = test
[core]
	editor = "C:\Program Files\Sublime Text 2\sublime_text.exe"
   
[apply]
    whitespace = fix

[color]
    branch = auto
    diff = auto
    interactive = auto
    status = auto


[core]
        pager = less -FRSX
        whitespace = cr-at-eol
        autocrlf = input
        excludesfile = /Users/test/.gitignore_global
        editor = mate -w

[alias]
        co = checkout
        lg = log --graph --pretty=oneline --abbrev-commit

[gui]
	recentrepo = Y:/Projects/Junk
	recentrepo = C:/xampp/htdocs/onlinemedia
[merge]
	tool = kdiff3

Screenshot of git config from GUI:

Git Config KDiff
Git Config KDiff

Running KDiff3:

Executing KDiff3
Executing KDiff3

KDiff3 display:

KDiff3 Display
KDiff3 Display