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,089 other followers

Archive for the ‘git’ Category

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 »

undo – Can I delete a git commit but keep the changes – Stack Overflow

Posted by jpluimers on 2020/09/02

I wanted to undo a commit, but forgot how to do that.

[WayBack] undo – Can I delete a git commit but keep the changes – Stack Overflow mentions to use

git reset HEAD^

However, on Windows, the ^ caret is an escape character, so there you have to use a ~ tilde instead:

git reset HEAD~

The last one is used in [WayBack] Git – Reset Demystified, and shorthand for

git reset --mixed HEAD~

The differences between --soft, --mixed and --hard is even better explained in [WayBack] The difference between git reset –mixed, –soft and –hard. From http://stackoverflow.com/questions/3528245/whats-the-difference-between-git-reset-mixed-soft-and-hard · GitHub.

In short:

  • --soft keeps the changes of the undone commit in the index (or staging area)
  • --mixed (default) keeps the changes of the undone commit in the working directory
  • --hard deletes the changes

–jeroen

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

 
%d bloggers like this: