Just when I thought I made a note of a password I hardly ever use, I didn’t, luckily this open source tools understands how to recover many kinds of passwords: AlessandroZ/LaZagne: Credentials recovery project.
–jeroen
Posted by jpluimers on 2019/04/15
Just when I thought I made a note of a password I hardly ever use, I didn’t, luckily this open source tools understands how to recover many kinds of passwords: AlessandroZ/LaZagne: Credentials recovery project.
–jeroen
Posted in *nix, *nix-tools, Chrome, Development, DVCS - Distributed Version Control, Firefox, git, Internet Explorer, Office, Opera, Outlook, Power User, Python, Scripting, Skype, Software Development, Source Code Management, Web Browsers, WiFi, Windows | Leave a Comment »
Posted by jpluimers on 2019/04/12
For only the latest commit message:
git log -1 --pretty=%B
For the full commit without diff:
git log -1
For the full commit including diff:
git show
Via: [WayBack] Often during a commit … I wish to read my last comment to remember what progress I have made (thanks Charles-Bailey!)
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2019/03/20
I had an error when doing a rename (mv) in git “unable to unlink old” “invalid argument”. This appeared to be a process having a lock on that file.
In my case, this was a bit hard to track down (I used Process Explorer for it), as the culprit was SourceTree running git in the background to keep an eye on changes in the repository because it has a file system watcher on the repository tree and a different process was writing log files in the same directory structure.
Can you still follow? I had a hard time so here it is in manageable bits:
Basically SourceTree should do two things:
I tracked down what happened using these tips:
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Source Code Management | Leave a Comment »
Posted by jpluimers on 2019/03/07
SourceTree does not like it when by accident two git stash entries have exactly the same name.
To work around that, you have to rename one.
The easiest way to do this is on the console using the tips from [WayBack] How can I rename a git stash? – Stack Overflow (thanks [WayBack] qzb):
$ git stash list
stash@{0}: WIP on master: Add some very important feature
stash@{1}: WIP on master: Fix some silly bugFirst, you must remove stash entry which you want to rename:
$ git stash drop stash@{1}
Dropped stash@{1} (af8fdeee49a03d1b4609f294635e7f0d622e03db)Now just add it again with new message using sha of commit returned after dropping:
$ git stash store -m "Very descriptive message" af8fdeee49a03d1b4609f294635e7f0d622e03dbAnd that’s it:
$ git stash list
stash@{0}: Very descriptive message
stash@{1}: WIP on master: Add some very important featureThis solution requires git 1.8.4 or later, and yes, it works with dirty working directory too.
Some other useful git stash commands:
{0} and prior {1} stash:
git stash show -pgit stash show -p{1}git stash list --date=localgit stash list --date=relative–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management, SourceTree | Leave a Comment »
Posted by jpluimers on 2019/03/05
Below are the git statements I used to solve this ASCII art problem from me (as I work in Git Flow feature branches):
old situation:
commit-1..4 - commit-5 - commit-6 - commit-7 - commit-8 - commit-9
^ ^ ^ ^ ^
| | | | |
master develop feature/A feature/old
to:
commit-1..4 - commit-5 - commit-6 - commit-7 - commit-8 - commit-9
^ ^ ^ ^ ^
| | | | |
master develop feature/A feature/old feature/new
git branch
git rev-parse HEAD
git log --pretty=format:'%H' -n 2
git checkout -b feature/new hash-of-commit-8
git branch --set-upstream-to=feature/old
git cherry-pick ..feature/old
git branch --force feature/old hash-of-commit-8
Step by step, this is what happens:
branch lists the current branchesrev-parse HEAD shows the hash of the current commit (commit-9)log --pretty=format:'%H' -n 1shows the hash of the previous two commits (from top to bottom: commit-9 and commit-8)checkout creates a new branch based on the past commit-8branch --set-upstream ensures the new branch tracks the old branchcherry pick ensures the new branch gets all the commits from the old branchbranch --force ensure the old branch looses the extra commits you wanted to only be in newBranchNameBased on
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Power User, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2019/02/04
[WayBack] RawGit: RawGit served raw files directly from GitHub with proper Content-Type headers.
This means you have to redirect your existing RawGit links before October 2019, and you cannot add new links on RawGit.
You might want to try alternatives, for instance this one I mentioned in 2017: raw.githack.com – like rawgit.com but supports bitbucket as well and runs on plain nginx.
raw.githack.com serves raw files directly from GitHub, Bitbucket or GitLab with proper Content-Type headers.
There are some other options that RawGit itself mentions:
What you should use instead
The following free services offer fantastic alternatives to some or all of RawGit’s functionality. You may like them even more than RawGit.
RawGit source is still at [WayBack] GitHub – rgrove/rawgit: Served files from raw.githubusercontent.com, but with the correct content types., so if you want to host your own alternative you can.
It means I need to change these pages:
–jeroen
Posted in Development, DVCS - Distributed Version Control, gist, GitHub, Power User, rawgit, Source Code Management | Leave a Comment »
Posted by jpluimers on 2019/01/10
When you search for git push "The requested URL returned error: 403", then the usual answer is “use ssh over https”, for instance at [WayBack] github – Pushing to Git returning Error Code 403 fatal: HTTP request failed – Stack Overflow.
However, lots of places (especially larger corporations and financials) limit outgoing traffic to http and https based for (often perceived) security reasons.
In this case, I needed a solution for Windows, which – after a long search – found two solutions that are below.
I use the https://gitlab.com/wiert.me/examples/sql-examples.git repository as an example, but it isn’t limited to GitLab: the same symptoms happen with other hosters as well (for instance on GitHub and BitBucket):
First what doesn’t work: they all give the same 403 message.
git version 2.13.3.windows.1)git config --local credential.helper cachegit config --local credential.https://gitlab.com.username wiertPushing to https://gitlab.com/wiert.me/examples/sql-examples.git
git: 'credential-cache' is not a git command. See 'git --help'.
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.com/wiert.me/examples/sql-examples.git/'The first thing that works is to include the actual password in the repository URL like this:
When you enter the correct password, everything is fine. Except that the password is stored as plain text on disk.
The real solution on Windows is to use the Windows Credential Manager. I found this because of the 5th failure above.
To see which username/password combinations have been stored or add your own, you can start the Credential Manager on the command-line like this (each Windows version seems to have a different path to the UI from the control panel; the console trick just works on all Windows versions I tested):
%windir%\explorer.exe shell:::{1206F5F1-0569-412C-8FEC-3204630DFB70}Note the above was the reason for writing List of Shell GUIDs for various Windows versions for use in shortcuts and batch files.
I have the impression that the “cached” credential manager will work on non-Windows systems, but need to find some time testing that on multiple platforms. Stay tuned (:
For that I need to look into at least these:
–jeroen
Posted in BitBucket, Development, DVCS - Distributed Version Control, git, GitHub, GitLab, Source Code Management | Leave a Comment »
Posted by jpluimers on 2018/12/21
Is there a URL query string for searching own GitHub Gists? – Stack Overflow.
Yes, there is, and search terms search within your gists too:
user:jpluimersuser:jpluimers tripledigitsMore search parameters are at https://github.com/random-parts/til/blob/master/github/gist-search-cheatsheet.md
–jeroen
Posted in Development, DVCS - Distributed Version Control, gist, git, GitHub, Power User, Source Code Management | Leave a Comment »
Posted by jpluimers on 2018/12/20
[WayBack] About Blocks – bl.ocks.org is so cool:
Bl.ocks (pronounced “Blocks”) is a simple viewer for sharing code examples hosted on GitHub Gist.
…
The main source for your example is in
index.html. This file can contain relative links to other files in your Gist, such as images, scripts or stylesheets. And of course you can use absolute links, such as CDN-hosted D3, jQuery or Leaflet. To explain your example, add aREADME.mdwritten in Markdown. (You can omit theindex.htmlif you just want to write, too.)
[WayBack] Code-only-Blocks are cool too:
When your Gist is missing an
index.htmlfile, will hide the example iframe but continue to display everything else.
Just compare these:
–jeroen
Posted in Development, DVCS - Distributed Version Control, gist, GitHub, jQuery, Scripting, Software Development, Source Code Management, Web Development | Leave a Comment »
Posted by jpluimers on 2018/12/18
I need this one day: [WayBack] git – I ran into a merge conflict. How can I abort the merge? – Stack Overflow
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »