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

Archive for the ‘git’ Category

How to have git log show filenames like svn log -v – Stack Overflow

Posted by jpluimers on 2020/12/01

I stick to git log --name-status as suggested in [WayBack] How to have git log show filenames like svn log -v – Stack Overflow.

A slightly less readable alternative isgit log --num-status .

There is also git log --name-only as suggested in [WayBack] How to show changed file name only with git log? – Stack Overflow

–jeroen

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

Git Mergetool and difftool with Beyond Compare 4 · GitHub

Posted by jpluimers on 2020/11/26

For my archive: [WayBack] Git Mergetool and difftool with Beyond Compare 4 · GitHub

jpluimers commented

I stuck to this as I:

  • do not run git bash
  • have Beyond Compared installed in the default directory (not the x86 one)
  • do not want a new UI instance, so use the recommended BComp.exe
git config --global merge.tool bc4
git config --global mergetool.bc4.cmd "'C:/Program Files/Beyond Compare 4/BComp.exe' \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
git config --global mergetool.bc4.trustExitCode true

This works splendid with git mergetool: it starts a merge in the already open BCompare.exe instance.

I only do merge from Beyond Compare, so no need for me to do a similar Beyond Compare setup for diff.tool, but if anyone wants it, it would be this:

git config --global diff.tool bc4
git config --global difftool.bc4.cmd "'C:/Program Files/Beyond Compare 4/BComp.exe' \"$LOCAL\" \"$REMOTE\""
git config --global difftool.bc4.prompt false

This works fine for any git versoin > 2.2.0.

Related:

What I need to find out is if it is possible to open all merges at once in Beyond Compare. Maybe these help:

This did help getting rid of .orig files: [WayBack] version control – Git mergetool generates unwanted .orig files – Stack Overflow

–jeroen

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

git – I ran into a merge conflict. How can I abort the merge? – Stack Overflow

Posted by jpluimers on 2020/11/25

Since I keep forgetting how simple it is: [WayBack] git – I ran into a merge conflict. How can I abort the merge? – Stack Overflow

If your git version is >= 1.6.1, you can use git reset --merge.

Also, as @Michael Johnson mentions, if your git version is >= 1.7.4, you can also use git merge --abort.

As always, make sure you have no uncommitted changes before you start a merge.

From the git merge man page:

git merge --abort is equivalent to git reset --merge when MERGE_HEAD is present.

MERGE_HEAD is present when a merge is in progress.

Also, regarding uncommitted changes when starting a merge:

If you have changes you don’t want to commit before starting a merge, just git stash them before the merge and git stash pop after finishing the merge or aborting it.

–jeroen

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

Checkout github pull requests locally · GitHub

Posted by jpluimers on 2020/11/18

Checkout github pull requests locally. GitHub Gist: instantly share code, notes, and snippets.

Source: [WayBack] Checkout github pull requests locally · GitHub

The trick is to add one more fetch line to the [remote "origin"] sections in your .git/config files, as in the gist below.

fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

Which reminds me I should read more about that the fetch syntax which is called RefSpec: [WayBack] Git – The Refspec

–jeroen

Read the rest of this entry »

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

Git pushing to multiple remotes

Posted by jpluimers on 2020/11/10

I didn’t know there were multiple ways to push to multiple remotes.

[WayBack] github – Git – Pushing code to two remotes – Stack Overflow is intriguing as the accept answer shows one remote can have more than one URL, and you can push to all of them at the same time.

Most people just have multiple remotes with one URL per remote, and have a branch optionally track one remote brach: [WayBack] How can I tell a local branch to track a remote branch?

The other way around: you can find out which branch track remote branches as well: [WayBack] git – Find out which remote branch a local branch is tracking – Stack Overflow

–jeroen

 

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

 
%d bloggers like this: