some git issues and resolutions

Git submodule head ‘reference is not a tree’ error
http://stackoverflow.com/questions/2155887/git-submodule-head-reference-is-not-a-tree-error

Git submodule update fatal error: reference is not a tree
http://stackoverflow.com/questions/13425298/git-submodule-update-fatal-error-reference-is-not-a-tree

Unstaged changes left after git reset –hard
http://stackoverflow.com/questions/11383094/unstaged-changes-left-after-git-reset-hard

 

 

Rewriting History

Git Interactive Rebase, Squash, Amend and Other Ways of Rewriting History
https://robots.thoughtbot.com/git-interactive-rebase-squash-amend-rewriting-history

Git: To squash or not to squash?
http://jamescooke.info/git-to-squash-or-not-to-squash.html

Squash several Git commits into a single commit
http://makandracards.com/makandra/527-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”
use
“$ git checkout master
$ git merge –squash newstuff”
https://kparal.wordpress.com/2011/07/04/git-tip-of-the-day-squashing-merges/

 

Merging / Rebasing

Merging vs. Rebasing
https://www.atlassian.com/git/tutorials/merging-vs-rebasing/conceptual-overview

 

Migrating from one git server to another

git clone –bare https://github.com/exampleuser/old-repository.git
# Make a bare clone of the repository

cd old-repository.git
git push –mirror https://github.com/exampleuser/new-repository.git
# Mirror-push to the new repository

cd ..
rm -rf old-repository.git
# Remove our temporary local repository
https://help.github.com/articles/duplicating-a-repository/

 

git clone –mirror URL
git remote add NEW-REMOTE URL
git push NEW-REMOTE –mirror
http://blog.plataformatec.com.br/2013/05/how-to-properly-mirror-a-git-repository/