Skip to content

Instantly share code, notes, and snippets.

😊

Tomasz Prasołek tomaszprasolek

😊
Block or report user

Report or block tomaszprasolek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tomaszprasolek
tomaszprasolek / git-feature
Last active Mar 27, 2019
Script create local branch and after that set upstream branch
View git-feature
#!/bin/bash
if [ x = x${1} ]; then
echo ">>> Enter branch name"
exit 1
fi
if [[ $1 == feature* ]]
then
BRANCH_NAME=$1
@tomaszprasolek
tomaszprasolek / createEmptyCommits.sh
Created Jan 9, 2019
Create 5 empty commits with passed message. For test purposes only.
View createEmptyCommits.sh
#!/bin/bash
for i in {1..5}
do
git commit -m "$1 $i" --allow-empty
done
@tomaszprasolek
tomaszprasolek / Change commiter and author date
Last active May 31, 2019
Change commiter and author date
View Change commiter and author date
git filter-branch --env-filter \
'if [ $GIT_COMMIT = 50421880a94e18f9344b43574eecbbab8e941c89 ]
then
export GIT_AUTHOR_DATE="Fri Nov 2 12:00:00 2018 +0000"
export GIT_COMMITTER_DATE="Fri Nov 2 12:00:00 2018 +0000"
fi'
View git reflog live script
while :; do
output=$(git reflog)
clear
echo "$output"
sleep 1
done
@tomaszprasolek
tomaszprasolek / git_script.ahk
Last active Jun 19, 2019
My Git AutoHotKey script.
View git_script.ahk
#SingleInstance force
#IfWinActive ahk_class VirtualConsoleClass
::grc::git rebase --continue
::gmt::git mergetool
::gpf::git push --force-with-lease
::gch::git checkout
::gri::git rebase -i HEAD~
::gc::git commit
::gca::git commit --amend
::gcan::git commit --amend --no-edit
View git-append
#!/bin/bash
USAGE="USAGE: git append TEXT_TO_APPEND NUMBER_OF_COMMITS\nExample: git append \"#3301\" 5"
show_usage () {
echo -e "\n$USAGE"
}
case $1 in
help | -h | "/?")
@tomaszprasolek
tomaszprasolek / git show-branch output
Last active Oct 25, 2018
Code is used in my blog.
View git show-branch output
! [master] Test commit 01 - master
* [feature] Test commit 03
--
+ [master] Test commit 01 - master
* [feature] Test commit 03
* [feature^] Test commit 02
* [feature~2] Test commit 01
+* [master^] Update ref tests
View Git bash start in cmder
C:\Program Files\Git\bin\sh.exe --login -i -new_console:d:"<path>"
View SublimeUserSettings.txt
{
"font_size": 14,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
"close_windows_when_empty": true
}
@tomaszprasolek
tomaszprasolek / filter-branch-prepend-and-append
Created Jul 11, 2018 — forked from openjck/filter-branch-prepend-and-append
Using sed and filter-branch to prepend and append to Git commit messages without newlines
View filter-branch-prepend-and-append
# Prepending text to the five most recent commit messages:
git filter-branch --msg-filter 'sed "s/\(.*\)/[prepended text] \1/g"' HEAD~5..HEAD
# Appending text to the five most recent commit messages:
git filter-branch --msg-filter 'sed "s/\(.*\)/\1 [appended text]/g"' HEAD~5..HEAD
You can’t perform that action at this time.