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 1,861 other subscribers

Archive for the ‘DVCS – Distributed Version Control’ Category

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 »

Git history in Visual Studio Code

Posted by jpluimers on 2020/11/04

Out of the box, Visual Studio Code does allow you to pull from and commit/push to git repositories, but it has not much more git support.

These two marketplace extensions will help big time:

I like GitLens most as it covers so much more than just git history.

If you only need git history access, then you can use Git History as well.

More information and a better comparison:

–jeroen

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

Plastic SCM blog: Unified diff of a branch

Posted by jpluimers on 2020/11/03

Too bad I bumped into this a long time after having been a regular PlasticSCM user: [Archive.is] Plastic SCM blog: Unified diff of a branch:

Learn how to create a custom action to run a unified diff operation for a Plastic SCM branch.

It is an open source tool called unifiedbranchdiff.exe at github, and seems based on a cm path for getting paths, and cm patch for generating the actual patch, and needing external GNU tools diff and patch (hopefully it also works with more recent versions than the woefully outdated 2007 Win32 versions of [WayBack] DiffUtils 2.8.7 for Windows and [WayBack] Patch 2.5.9 for Windows).

Related:

–jeroen

 

 

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

Thread by @doctorow on the RIAA using DMCA section 1201 to ban youtubedl from GitHub

Posted by jpluimers on 2020/10/31

A very interesting thread by @doctorow:

Late last week, the @RIAA sent a legal threat to @Github, claiming that the popular (and absolutely lawful) tool #youtubedl (which allows users to download Youtube videos for offline viewing, e……

Source: [WayBack] Thread by @doctorow on Thread Reader App – Thread Reader App

More on section 1201: [Wayback] Pluralistic: 24 Oct 2020 – Pluralistic: Daily links from Cory Doctorow: RIAA kills youtubedl

There is also a great technical analysis at [Wayback/Archive.is] Analysis of the RIAA claims against youtube-dl · GitHub

This write-up follows the code paths in youtube-dl that get executed when you try to run it based on the claims of RIAA has put forwardThis is a technical analysis, not a legal one.

via

–jeroen

Read the rest of this entry »

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

Some links on assembling a proper Katalon .gitignore file

Posted by jpluimers on 2020/10/29

I used these links to find out what entries a Katalon .gitignore file should contain:

Combining the above, the .gitignore file needs to at least contain:

/.classpath
/.project
/.settings
bin/lib/
Libs/
/bin
/Libs
.settings
.classpath
settings/internal
/.svn
/bin/lib/Temp*.class
Reports/
.project
/libs/Temp*.groovy
bin/lib/
bin/keyword/

(funny that .svn should be in a .gitignore file and that various combinations of casing are used)

–jeroen

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

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 »