Simple git alias that does pull --ff-only. It is possible to configure git pull to do --ff-only by default - https://blog.sffc.xyz/post/185195398930/why-you-should-use-git-pull-ff-only-git-is-a
but I prefer to have default settings for commands to have fine-grained control over the operations.
Open .gitconfig (usually it is in c:/users/YOUR-USER/.gitconfig) and add an alias:
December 28, 2021
git alias to pull forward only
December 16, 2021
git alias to pull another branch and checkout it
Open .gitconfig (usually it is in c:/users/YOUR-USER/.gitconfig) and add an alias:
Then instead of doing
You can do
And avoid double changes that cause reload in IDE.
December 01, 2021
Simplify folder navigation in windows terminal powershell
Open settings json file in windows terminal (ctrl+shift+,), find "actions" json array, add two commands (don't forget about preceding coma):
From now on pressing Alt+Up will go one level up (like in Windows Explorer) and pressing Alt+Down will bring powershell hint for switching the directory:
The trick here is to use \u0000 which is a terminal equivalent of pressing Ctrl+Space. It is applicable only to powershell, since there is no directory browsing feature in a regular cmd.
January 04, 2021
How to remove all local git branches except master through Powershell
git branch -D @(git branch --format '%(refname:lstrip=2)' | where {$_ -ne 'master'} )
October 16, 2020
How to remove annoying items from windows explorer context menu
Menu items should be removed from registry.
Share with skype:
Remove HKEY_CLASSES_ROOT\*\shell\Share with skype
Remove HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PackagedCom\Package\Microsoft.SkypeApp(XXXXXXX and so on)\Class\{xxxxxx}
Create a new string key to forbid Skyep to create this menu again HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked\{776DBC8D-7347-478C-8D71-791E12EF49D8}
Move to OneDrive:
Create a new string key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked\{CB3D0F55-BC2C-4C1A-85ED-23ED75B5106B}
October 07, 2020
Deterministic builds for .NET in .csproj
August 21, 2020
tgit script to use TortoiseGit from command line
April 06, 2017
April 05, 2017
March 13, 2017
How to base your branch on different branch
https://makandracards.com/makandra/10173-git-how-to-rebase-your-feature-branch-from-one-branch-to-another
git checkout feature/mybranch
git rebase --onto new_target_branch current_parent_branch
November 30, 2015
Shortcut cheat sheets
Resharper - https://www.jetbrains.com/resharper/docs/ReSharper_DefaultKeymap_VSscheme.pdf
Chrome developer tools - https://developers.google.com/web/tools/chrome-devtools/iterate/inspect-styles/shortcuts
November 20, 2015
Useful git commands cheat-sheet
git push origin --tags
git push --set-upstream origin name
git branch -u origin/foo - track remote branch
git remote -v - view list of remotes
git remote set-url origin
git branch -m newname - rename current branch
git push origin master -f - forced push
Rebase branch
git checkout feature/branchgit rebase master
git checkout master
git merge feature/branch // fast-forward here
Cleanup
git branch -D name - delete branch locallygit push origin --delete branchname or git push origin :branchname (:branchname should not exist locally then)git
git tag -d name - delete tag locally
git push origin :refs/tags/name - delete tag remotely
git reset --hard HEAD~1 - one commit back
git remote show origin (shows what is in origin and what is stale)
git remote prune origin (removes all local garbage from repo)
git branch -lvv (view list of branches with remotes and marks if remote gone)
git clean -df (remove all untracked files)
git checkout . (discard all the changes to tracked files)
Code snippet to investigate an object content without dances with debugger in C#
var investigated = ...; // assign your object here System.IO.File.WriteAllText( @"D:\test.json", Newtonsoft.Json.JsonConvert.SerializeObject( investigated, new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, TypeNameHandling = Newtonsoft.Json.TypeNameHandling.Objects }));
