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

Oh, shit, git. via Kristian Köhntopp – Google+

Posted by jpluimers on 2016/09/10

Oh, shit, git. For +Tatiana Azundris, Originally shared by Stefani Banerian

Source: Kristian Köhntopp – Google+

Oh, shit, git!
Oh shit, git! Git is hard: screwing up is easy, and figuring out how to fix your mistakes is fucking impossible. Git documentation has this chicken and egg problem where you can’t search for how to get yourself out of a mess, unless you already know the name of the thing you need to know about …

Right now the site is down from Amsterdam; luckily we have http://web.archive.org/web/20160909123413/http://ohshitgit.com/

If you’re fast, you might see http://ohshitgit.com redirect to http://ohshitgit.com/cgi-sys/suspendedpage.cgi which shows:

The website you were trying to reach is temporarily unavailable.
Please check back soon.
If you are the owner of this website, please contact Technical Support as soon as possible.

–jeroen

Image source: xkcd: Git [WayBack] via Christian Vogel [WayBack]

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

“Yes/No” question with what kind of buttons? Indeed “Yes/Cancel” SourceTree for Windows installer – latest version.

Posted by jpluimers on 2016/09/07

Yes, people still do this: Screenshot 2016-09-07 15.59.24.png

This one is worse than the usual “Yes/No” questions missing one or more of the “Yes” or “No” buttons in that it actually mentions you can click “No”.

Load SSH Key?

Do you have an SSH kkey that you’d like to load now? If not you can click “No” and create one later if you like”.

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

Mercurial/Hg; syntax/tips for amend commit adding/reming files to latest (non-pushed) commit

Posted by jpluimers on 2016/09/01

Sometimes your latest commit isn’t what you intended. Fixing can be done, but isn’t always obvious hence these links:

Remove a new file from a commit:

cp somefile.txt somefile.txt.bak
hg forget somefile.txt
hg commit --amend

If the file was new (i.e. you had used hg add).

If that file already existed try:

cp somefile.txt somefile.txt.bak
hg revert somefile.txt --rev .~1
hg commit --amend
cp somefile.txt.bak somefile.txt

–jeroen

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

When “git mv” on a directory gives you en error starting with “fatal: bad source”

Posted by jpluimers on 2016/08/23

I use “git mv” a lot because somehow it works a lot better than having git automagically find out about renames.

The problem with “git mv” is that the “fatal: bad source” errors are a catch-all for many causes. Just look at the

Searching for “git mv” directory “fatal: bad source” didn’t get me much further. The one link that did get me towards the right track is version control – Getting Git to follow renamed and edited files – Stack Overflow.

What happened was that I had manually deleted and edited some files as part of a mass script (the repository had a lot of files in it that didn’t belong there compile targets and user specific settings or didn’t adhere to the naming conventions) before executing the “git mv”.

Since “git mv” tries to administer all the files that it thinks originally were in the directory, it complains about those files.

Lesson learned: first “git mv” then perform other changes.

–jeroen

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

Push a new local branch to a remote Git repository and track it too – Stack Overflow

Posted by jpluimers on 2016/07/27

Just what I needed: Push a new local branch to a remote Git repository and track it too – Stack Overflow But watch the comments to this answer:

Answer:

In recent versions of Git (1.7.0 and later), you can checkout a new branch:

git checkout -b <branch>

Edit files, add and commit. Then push with the -u option:

git push -u origin <branch>

Git will set up the tracking information during the push.

Daniel Ruoso / Dan

Comments:

  • git push -u was introduced in Git 1.7.0 (2010-02-12). – Chris Johnsen Jun 4 ’11 at 4:16
  • Would you be kind enough to elaborate? Some git commands do more than one thing, and I’m not sure what origin and mynewfeature refer to. Is mynewfeature a branch name? Is origin a shortcut for a full remote repo url? Also what does the -u flag do? – Costa Mar 6 ’14 at 21:16
  • @Costa ‘origin’ is the name of default remote in Git repository. ‘mynewfeature’ here is branch name. -uis short for --set-upstream—for what it does and why it’s needed I wouldn’t mind some explanation, too. :) – Anton Strogonoff Mar 9 ’14 at 6:07
  • It’s also worth noting that if you have an existing tracking branch already set on the branch you’re pushing, and push.default is set to upstream, this will not do what you think it will do. It will try to push over the existing tracking branch. Use: git push -u origin mynewfeature:mynewfeature or dogit branch --unset-upstream first. – void.pointer May 19 ’14 at 18:07
  • I still needed to ‘git branch –set-upstream-to origin/remote’ in order for ‘git status’ to correctly report my branch status with respect to the remote branch. – Paul Whipp Jul 4 ’14 at 1:17
  • For people using Git from Visual Studio: Actually this is that “Publish Branch” in Visual Studio does. After executing git push with -u parameter i can finally see my branch as published in VS UI. – Puterdo Borato

 

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management, Visual Studio 2013, Visual Studio 2014, Visual Studio 2015, Visual Studio and tools | Leave a Comment »

Git Cheat Sheet

Posted by jpluimers on 2016/07/14

I had seen the bitmap Git Cheat Sheet referenced numerous times, so I went searching for the source and found it under Creative Commons 3.0 license at http://byte.kde.org/~zrusin/git/ which has the Vector Image Source by Zack Rusin.

[ICO] Name Last modified Size Description

[DIR] Parent Directory
[IMG] git-cheat-sheet-large.png 29-Aug-2007 14:52 1.2M
[IMG] git-cheat-sheet-medium.png 29-Aug-2007 14:52 336K
[IMG] git-cheat-sheet.svg 29-Aug-2007 14:52 162K
[IMG] git-cheet-sheet-small.png 10-Sep-2007 09:05 87K
[TXT] license.html 29-Aug-2007 08:41 24K

And yes, they are all in the Wayback Machine: http://web.archive.org/web/*/http://byte.kde.org/~zrusin/git/

–jeroen

via: Zack Rusin: Git cheat sheet.

Git Cheat Sheet Git Cheat Sheet

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

GitHub has majour service outages…

Posted by jpluimers on 2016/07/06

Boom!

In a split second GitHub went to

 

from

from 

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

case insensitive files systems and git – Lesson Learned – I Can’t Get My Git Repo Clean! | DrupalEasy

Posted by jpluimers on 2016/07/06

via: Lesson Learned – I Can’t Get My Git Repo Clean! | DrupalEasy

One file kept getting added to the git modified list: service/src/main/MySOAPdefinition.pas.

It was part of a repository that had been migrated from SVN (more on that in a future blog post) and along the way been renamed in directory service/src/main from MySOAPdefinition.pas to MySoapDefinition.pas. SVN (and TortoiseSVN) don’t object to this. But git does.

You’d see this on the command-line:

>git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

        modified:   service/src/main/MySOAPdefinition.pas

no changes added to commit (use "git add" and/or "git commit -a")

>git add service\src\main\MySoapDefinition.pas

>git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

        modified:   service/src/main/MySOAPdefinition.pas

no changes added to commit (use "git add" and/or "git commit -a")

Basically the add would do nothing.

On Windows, this is how to get around this:

Read the rest of this entry »

Posted in Delphi, Delphi XE8, Development, git, Mac OS X / OS X / MacOS, OS X 10.9 Mavericks, Power User, Software Development, Source Code Management, SourceTree, Windows, Windows 7 | 1 Comment »

git svn broken on Mac OS X under SourceTree but not from the terminal: how to fix it.

Posted by jpluimers on 2016/07/05

Not on the terminal, but only in SourceTree I got this error (full text below):

Can't locate SVN/Core.pm in @INC

Well, the Xcode binaries were here:

 $ xcode-select -p
/Applications/Xcode.app/Contents/Developer

On Mavericks, perl is this version:

$ perl --version | grep -w for
This is perl 5, version 16, subversion 2 (v5.16.2) built for darwin-thread-multi-2level
(with 3 registered patches, see perl -V for more detail)

and git is this:

$ git --version
git version 1.9.5 (Apple Git-50.3)

Steps for fixing are at these blog entries:

All these solutions point you to change the system Perl installation, but since on my system it failed only on SourceTree, but from the terminal, I wanted to fix SourceTree.

Read the rest of this entry »

Posted in Apple, Development, DVCS - Distributed Version Control, git, Mac OS X / OS X / MacOS, OS X 10.9 Mavericks, Power User, Source Code Management, Subversion/SVN | 4 Comments »

Storing binaries in your gists

Posted by jpluimers on 2016/06/28

At first you’d think that gists can only hold text files. That’s not true, and I hinted to this last week in Hosting an HTML gist containing JavaScript.

As gists are git repositories, you can put any file in it through git, even binary files, though the gist UI nor a lot of the tools – including gist(1) – support uploading binary files in a gist.

This post – though old, so the screenshots are not current any more, but the commands still are current – explains how to clone the gist and add binaries (in this case images): How To Upload Image / Binary File to Gist | Hanxue and IT

This is for instance how I created a gist containing openssl Darwin binaries to help solve https://github.com/drwetter/testssl.sh/issues/362.

–jeroen

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