Skip to content

Instantly share code, notes, and snippets.

@etenesaca
Created August 14, 2014 14:34
Show Gist options
  • Select an option

  • Save etenesaca/a69eb654bdd4754d99d7 to your computer and use it in GitHub Desktop.

Select an option

Save etenesaca/a69eb654bdd4754d99d7 to your computer and use it in GitHub Desktop.
Migrar un repositorio BZR a Git
#!/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
@etenesaca
Copy link
Author

En donde dice "cat >.gitignore" se puede poner las extensiones de los archivos que se quiere que se ignoren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment