Skip to content

Instantly share code, notes, and snippets.

@show0k
Last active May 29, 2019 15:57
Show Gist options
  • Save show0k/2b288c2160e43c463806ceab392df317 to your computer and use it in GitHub Desktop.
Save show0k/2b288c2160e43c463806ceab392df317 to your computer and use it in GitHub Desktop.
Git self cheat sheey

Delete a submodule

git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit-m "Removed submodule "
rm -rf .git/modules/<path_to_submodule>

Make a branch concurent to master being the new master branch without loosing datas

git checkout mybranch
git merge --strategy=ours --no-commit master
git checkout master
git merge mybranch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment