Tuesday, March 26, 2013

How can you put uncommitted changes to a branch TEST when I am at the branch master

Every once in a while, I start changing code before switching to a new branch... then.... nuts!

I need to move these uncommitted changes to a new branch, or ... throw them away and start again.

Two Options:
1) You can just checkout to the new branch and then commit. You don't lose your uncommitted changes when moving to another branch.

git checkout -b new-branch-name
git add . 

2) Use Git Stash as a copy & paste:
git stash
git checkout other-branch-name
git stash apply

Thanks to Here

Monday, March 11, 2013

Git Production Server Updating

A quick note,

If you want to update a production server's versioned files, and discard local changes (which there shouldn't be any... right?)

discard local changes, and replace them with the most recent commit that exists on the github server (origin) on branch production:

> git reset --hard origin/production

Thanks for help on this from: Here