Created
December 14, 2014 21:01
-
-
Save ringods/168c2cf7726a536deb9c to your computer and use it in GitHub Desktop.
Migrating from TFS to Git with converted metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These files are text and should be normalized (convert crlf => lf) | |
*.cmd text | |
*.config text | |
*.Config text | |
*.cs text diff=csharp | |
*.csproj text | |
*.datasource text | |
*.disco text | |
*.edmx text | |
*.map text | |
*.md text | |
*.msbuild text | |
*.ps1 text | |
*.settings text | |
*.sln text | |
*.svcinfo text | |
*.svcmap text | |
*.t4properties text | |
*.tt text | |
*.txt text | |
*.vspscc text | |
*.wsdl text | |
*.xaml text | |
*.xsd text | |
# Images should be treated as binary | |
# (binary is a macro for -text -diff) | |
*.ico binary | |
*.jepg binary | |
*.jpg binary | |
*.sdf binary | |
*.pdf binary | |
*.png binary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user@host:MyComponent$ git add .gitattributes | |
user@host:MyComponent$ git commit -m "Central repository configuration" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git filter-branch -f --env-filter ' | |
case ${GIT_COMMITTER_NAME} in | |
"DOMAIN\joe") name="Joe" ; email="[email protected]" ;; | |
"DOMAIN\foo") name="Foo" ; email="[email protected]" ;; | |
"DOMAIN\baz") name="Baz" ; email="[email protected]" | |
esac | |
export GIT_AUTHOR_NAME="$name" | |
export GIT_AUTHOR_EMAIL="$email" | |
export GIT_COMMITTER_NAME="$name" | |
export GIT_COMMITTER_EMAIL="$email" | |
' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user@host:MyComponent$ git rm --cached -r . | |
user@host:MyComponent$ git reset --hard | |
user@host:MyComponent$ git add . | |
user@host:MyComponent$ git commit -m "Introducing normalised line-endings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user@host:~$ git tf clone --deep --no-tag http://tfs.domain.local:8080/tfs/MyCode $/MyComponent/Development/Development MyComponent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user@host:MyComponent$ git gc --prune=now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user@host:MyComponent$ git remote add origin http://[email protected]/MyComponent.git | |
user@host:MyComponent$ git push origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user@host:~$ cd MyComponent | |
user@host:MyComponent$ git branch -rd origin_tfs/tfs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment