Git Notes #2 [credentials, remote, lf-crlf]

This is new set of git notes. First is here.

687474703a2f2f636c2e6c792f31493233336a316c3258336333313143314331482f4769742d4c6f676f2d32436f6c6f722e706e67

Multiple user.name

When you have issues like this:
g1
You might have added a few values for one config setting. git config --list will show it for you. Next you may hit git config -e (and edit mode will be opened) or unset:

git config --get-all user.name #local repo git config file.
git config --global --get-all user.name #user config file.
git config --system --get-all user.name #system git config file.

FYI: Helper Resource.

Password helper for Windows

I used to use “git config credential.helper store”, but time ago I faced with issue in cloned repo via SSH access. And I was working on Windows. So there is “git-credential-winstore.exe”

Unzip the file and run the git-credential-winstore.exe program inside. This will start up the helper and update your git config to use it.
Tip: The credential helper only works when you clone an HTTPS repository URL. If you use the SSH repository URL instead, SSH keys are used for authentication.

FYI: Resource 1, Resource 2.

Access to remote repo.

There was another need to fetch data via https, but with no credentials via plain text.
Some repositories on github, when I pushed, respond me like this:

fatal: could not read Username for 'https://github.com': No such file or directory

So I googled, and here is solution:

git remote set-url origin git@github.com:username/repo.git

Or if you like 2-steps 🙂

git remote rm origin
git remote add origin 'git@github.com:username/repo.git'

But this did not help much.
The only one way to use password as plain text:

https://user:pass@github.com/folderXYZ/repo.git

After that all repositories I have on Windows, use file %USERPROFILE%\.git-credentials with plaintext hardcoded user and pass.

LF/CRLF Issue

When I reinstalled my Git on Windows with no LF/CRLF change, my existed git repositories were with code change like 100%, but the same file content. Basically, it was change on binary level.

So when you start project, make sure:

  1. You are installing with setting “AS IS” on 3rd or 4th window/step.
  2. Double check by executing “git config --list“, you should have
core.autocrlf = false 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s