some git issues and resolutions

Git submodule head ‘reference is not a tree’ error

Git submodule update fatal error: reference is not a tree

Unstaged changes left after git reset –hard



Rewriting History

Git Interactive Rebase, Squash, Amend and Other Ways of Rewriting History

Git: To squash or not to squash?

Squash several Git commits into a single commit



Squash merging: Instead of
“$ git checkout newstuff
$ git rebase master # or ‘git merge master’
$ git checkout master
$ git diff –binary master newstuff > patch
$ git apply patch
$ rm patch”
“$ git checkout master
$ git merge –squash newstuff”


Merging / Rebasing

Merging vs. Rebasing


Migrating from one git server to another

git clone –bare
# Make a bare clone of the repository

cd old-repository.git
git push –mirror
# Mirror-push to the new repository

cd ..
rm -rf old-repository.git
# Remove our temporary local repository


git clone –mirror URL
git remote add NEW-REMOTE URL
git push NEW-REMOTE –mirror