Andrew Fletcher published: 7 March 2022 1 minute read
Changing git push from passphrase? There are several ways to tackle this step. I'm going to focus one of these steps.
From your web directory root, look for your .git directory. Then open the .git...
cd .git
Next using your shell prompt (iTerm2), view the contents of the config file
vim config
Presently the config file looks like the following
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = git@github.com:{username}/{repo}.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "origin/main"] remote = . merge = refs/heads/main [branch "main"] remote = origin merge = refs/heads/main
The line I want to focus on is the URL: url = git@github.com:{username}/{repo}.git
Backup
Before I made changes to the config file, I created a back-up of it
cp config config_bkup
Now I edited this file by changing the url line to
url = https://github.com/{username}/{repo}.git
So in context config file will now look like:
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = true [remote "origin"] url = https://github.com/{username}/{repo}.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "origin/main"] remote = . merge = refs/heads/main [branch "main"] remote = origin merge = refs/heads/main
Finally I saved the file
[esc]:wq!
Test test test
Does it work? It should, but I check.
Create a commit and push.
Working!
Related articles
Andrew Fletcher
•
16 Jan 2025
get IP address from terminal OSX
When troubleshooting network issues or configuring devices, knowing your IP address can be essential. Whether you're connected via Wi-Fi, Ethernet, or tethering through a mobile provider, macOS offers powerful built-in tools to quickly identify your IP address. Here's a practical guide tailored to...
Andrew Fletcher
•
07 Jan 2025
Managing DDEV environment troubleshooting and setting up multiple Drupal projects
DDEV has become a popular tool for local web development, offering a streamlined approach to managing Docker-based environments. However, setting up and managing DDEV projects, particularly with the latest versions of Docker Desktop, can present challenges. This article guides you through resolving...
Andrew Fletcher
•
28 Dec 2024
Optimising file transfers by improving efficiency from cp to rsync
Transferring files between development and production environments is a critical task in the deployment process. However, I continue to come across multiple approaches that scale from awesome automation using pipelines to the basic of direct command line entry. Where the basic approaches rely on...