Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Friday, November 18, 2016

[HowTo] Configure Bitbucket or GitHub with multiple SSH keys


Tuesday, November 8, 2016

Configure Jenkins to work with Git repositories over SSH

Thursday, June 30, 2016

Rename Git user in pushed commits

#!/bin/sh

git filter-branch --env-filter '
OLD_EMAIL="wrong@gmail.com"
CORRECT_NAME="vurdalakov"
CORRECT_EMAIL="vurdalakov@gmail.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
    export GIT_COMMITTER_NAME="$CORRECT_NAME"
    export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
    export GIT_AUTHOR_NAME="$CORRECT_NAME"
    export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags

Tuesday, June 21, 2016

Batch file to clone/pull all GitHub repositories for a given user

@echo off
@setlocal enableextensions enabledelayedexpansion

set gituser=vurdalakov

set curl=curl.exe
set git=git.exe

for /f "delims=" %%a in ('%curl% -i -s https://api.github.com/users/%gituser%/repos') do (
        set line=%%a
        if not !line!==!line:"name"=! (
            set line=!line:"=!
            set line=!line:name:=!
            set line=!line:,=!
            set name=!line: =!
            if exist !name!\nul (
                cd !name!
                %git% pull
                cd ..
            ) else (
                %git% clone https://github.com/%gituser%/!name!.git
            )
        )
    )
)


Batch file to print all public GitHub repositories for a given user

@echo off
@setlocal enableextensions enabledelayedexpansion

set gituser=vurdalakov

set curl=curl.exe

for /f "delims=" %%a in ('%curl% -i -s https://api.github.com/users/%gituser%/repos') do (
        set line=%%a
        if not !line!==!line:"name"=! (
            set line=!line:"=!
            set line=!line:name:=!
            set line=!line:,=!
            set line=!line: =!
            echo !line!
        )
    )
)


Wednesday, June 8, 2016

How to ignore whole directory except one file with .gitignore



!bin
bin/*
!bin/Release
bin/Release/*
!bin/Release/MyApplication.exe