Studyon Minte9.com
Git




Branch backup



When you work on some branch you might forget to backup it.
"git push origin master" doesn't push other branches

Use "git push origin dev" to backup what you have workend on "dev" branch.

        $ mkdir www && cd www
	$ echo 1 > index.htm
	$ git init
	$ git add . && git commit -m "m1"

	$ cd ..

	$ git clone /d/developments/testgit/www user1
	$ cd user1/

	(master)
	$ git checkout -b dev

	(dev)
	$ echo 2 > index.htm
	$ git commit -a -m 'dev'

	(dev)
	$ git remote -v
	origin  d:/developments/testgit/www (fetch)
	origin  d:/developments/testgit/www (push)

	(dev)
	$ git push origin master
	Everything up-to-date

	(dev)
	$ git push origin dev
	Total 0 (delta 0), reused 0 (delta 0)
	To d:/developments/testgit/www
	 * [new branch]      dev -> dev

	(dev)
	$ cd ../www

	(master)
	$ less index.htm
	1

	$ git checkout dev

	(dev)
	$ less index.htm
	2