카테고리 없음2013. 8. 6. 15:37

git

author 정보 바꾸기

https://help.github.com/articles/changing-author-info

#!/bin/sh

 

git filter-branch --env-filter '

 

an="$GIT_AUTHOR_NAME"

am="$GIT_AUTHOR_EMAIL"

cn="$GIT_COMMITTER_NAME"

cm="$GIT_COMMITTER_EMAIL"

 

if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]

then

    cn="Your New Committer Name"

    cm="Your New Committer Email"

fi

if [ "$GIT_AUTHOR_EMAIL" = "your@email.to.match" ]

then

    an="Your New Author Name"

    am="Your New Author Email"

fi

 

export GIT_AUTHOR_NAME="$an"

export GIT_AUTHOR_EMAIL="$am"

export GIT_COMMITTER_NAME="$cn"

export GIT_COMMITTER_EMAIL="$cm"

'




subdirectory 분리하기

http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository

https://help.github.com/articles/splitting-a-subpath-out-into-a-new-repository


git clone /XYZ /ABC

cd /ABC

for i in branch1 br2 br3; do git branch -t $i origin/$i; done

git remote rm origin

git filter-branch --tag-name-filter cat --prune-empty --subdirectory-filter ABC -- --all

git reset --hard
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git reflog expire --expire=now --all
git gc --aggressive --prune=now


Posted by asdfzxcv