Created
May 29, 2019 08:29
-
-
Save gjabouley-invn/310b111e749880d62b681c8f7645e77e to your computer and use it in GitHub Desktop.
Some usefull git commands
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
# Create a branch name using short commit sha1, then push on it | |
BRANCH_NAME=migration/$(git log -1 --pretty=format:%h)_submodule_github | |
git checkout -b $BRANCH_NAME | |
git commit -am "[GITHUB MIGRATION] Update submodules urls on protected branches" | |
git push --set-upstream origin $BRANCH_NAME | |
# Git lfs migrate | |
export REPO_URL=<REPO_COMPLETE_URL> | |
git clone --mirror ${REPO_URL} local_folder && pushd local_folder && git lfs fetch --all && git lfs migrate --everything info | |
git lfs migrate import --everything --verbose --object-map=../mapping_file.map.txt --include="<PATTERNS>" (ex: *.apk,*.png) | |
sed -i 's/,/ /g' ../mapping_file.map.txt && git reflog expire --expire-unreachable=now --all && git gc --prune=now --aggressive | |
git lfs push origin --all && git push -f origin --mirror | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment