Created
August 14, 2014 14:34
-
-
Save etenesaca/a69eb654bdd4754d99d7 to your computer and use it in GitHub Desktop.
Migrar un repositorio BZR a Git
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/bash | |
| #Migrar de BZR a GIT | |
| Path=$1 | |
| cd $Path | |
| #Configurar Correctamente las credencjales | |
| git config --global user.name "Edgar Tenesaca" | |
| git config --global user.email "edgartenesaca@gmail.com" | |
| git init | |
| bzr fast-export --plain `pwd` | git fast-import | |
| #--------------------------------------------------- | |
| for FILE in *; do rm -rfv "${FILE}"; done | |
| #--------------------------------------------------- | |
| rm -rf .bzr README | |
| git reset HEAD | |
| #--------------------------------------------------- | |
| cat >.gitignore<<ENDGITATTRIBS | |
| # built application files | |
| *.py[co] | |
| *~ | |
| # Eclipse project files | |
| .classpath | |
| .project | |
| .settings/ | |
| *.pydevproject | |
| ENDGITATTRIBS | |
| git add .gitattributes | |
| find -empty -type d -not -iwholename '*.git*' -exec touch '{}/.gitkeep' ";" | |
| git add **/.gitkeep | |
| git commit -a -m "Migrated from Bazaar to Git." | |
| git filter-branch -f --index-filter "git rm --cached --ignore-unmatch *.THIS *.THAT" \ | |
| --prune-empty --tag-name-filter cat -- --all | |
| rm -rf .git/refs/original/ | |
| git reflog expire --expire=now --all | |
| git gc --prune=now | |
| git rm --cached -r . | |
| git reset --hard | |
| git add . | |
| git commit -m "Agregado .gitignore" | |
| git gc --aggressive --prune=now |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
En donde dice "cat >.gitignore" se puede poner las extensiones de los archivos que se quiere que se ignoren