Skip to content

dev08 pushing code with git

Tom Purucker edited this page Jun 7, 2018 · 1 revision

old google doc

creating a new branch

git checkout -b new_branch
git push origin new_branch

adding a submodule

git submodule add https://github.com/quanted/some_submod_name

deleting a submodule

# delete the relevant section from the .gitmodules file [submodule "submodule_name"]
git add .gitmodules
# delete the relevant section from .git/config [submodule "submodule_name"]
git rm --cached submodule_name
rm -rf .git/modules/submodule_name
# commit the change
rm -rf submodule_name

removing a file from the entire git history of commits

# change dir/your-filename-here
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch dir/your-filename-here' --prune-empty --tag-name-filter cat -- --all