The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,113 other followers

Archive for the ‘Source Code Management’ Category

Must read post when using Git on line endings: What’s the best CRLF handling strategy with git? – Stack Overflow

Posted by jpluimers on 2020/09/23

Start with this must read post: cross platform – What’s the best CRLF handling strategy with git? – Stack Overflow.

Then read all the links in that answer, especially

Then see if you agree with my conclusion:

use a .gitattributes file to steer line ending conversions on a per-repository base.

I usually try to have git not mess with any line endings: check-out as-is, check-in as is.

Historically this has been a mess (not limited to, but prevalent on Windows installations), not just because core.autocrlf has been superseded by core.eol, so below are some links that will help.

TL;DR

Always execute these after installing git:

git config --global core.autocrlf false
git config --global core.eol native

If needed, repeat in the current repository:

git config --local core.autocrlf false
git config --local core.eol native

Finally verify the settings with git config --list --show-origin (via [WayBack] Where does git config –global get written to? – Stack Overflow)

Note

The git config list will show equals signs. Do NOT use these when setting values: that will silently fail.

So these fail:

git config --global core.autocrlf=false
git config --global core.eol=native

git config --local core.autocrlf=false
git config --local core.eolnative

Despite the output when listing on a machine that already had these values et:

git config --list | grep -w 'core.autocrlf\|core.eol'
core.autocrlf=false
core.eol=native
core.autocrlf=false
core.eol=native

References

–jeroen

PS: To look at the various local and global settings, read Where does git config –global get written to? – Stack Overflow.

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

git – Change commit author at one specific commit – Stack Overflow

Posted by jpluimers on 2020/09/22

Every now and then I forget to git config --local user.name and git config --local user.email, so git takes my global settings and I need to fix one or more commits to it shows the correct author.

For the last commit, when not yet pushed, this is easy:

git commit --amend --author="Author Name <email@address.com>"

For historic commits, or when you already pushed, it gets far more difficult, so I am glad there is a good set of steps at [WayBackgit – Change commit author at one specific commit – Stack Overflow.

For now in my %USERPROFILE%\.gitconfig file, I have added entries for various accounts so it is easier to spot them with git config --list --global then edit them using git config --edit --local:

[user.foo]
    name = jeroenfo
    email = ########+jeroenfoo@users.noreply.github.com
[user.gh]
    name = Jeroen Wiert Pluimers
    email = jeroen.vvv.www@pluimers.com
[user.gl]
    name = Jeroen Wiert Pluimers
    email = jeroen.xxx.yyy@pluimers.com

If you pushed, but nobody pulled, and you are the only one committing, then the steps are like this if your git is 1.8 or higher:

  1. Once,
    1. perform git rebase -i --root
    2. at all commits you want to edit, change pick into edit
    3. write the file, then leave the editor (:wq)
  2. For each commit, until git indicates No rebase in progress?:
    1. perform git commit --amend --reset-author --no-edit
    2. perform git rebase --continue

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

Filename too long in Git for Windows – Stack Overflow

Posted by jpluimers on 2020/09/10

[WayBack] Filename too long in Git for Windows – Stack Overflow:

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v "LongPathsEnabled" /t REG_DWORD /d 1 /f

Related:

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

19 Best Git clients for Windows as of 2018/2019/… – Slant

Posted by jpluimers on 2020/09/08

Despite the year, this page still got updates long after the initial edit [WayBack] 19 Best Git clients for Windows as of 2018 – Slant.

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development | Leave a Comment »

getting a svn compatible patch diff from the latest commit in a git branch

Posted by jpluimers on 2020/09/03

git diff --no-prefix @~

Via various sources:

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management, Subversion/SVN | Leave a Comment »

 
%d bloggers like this: