Thread (27 messages) flat view 27 messages, 10 authors, 2016-06-15

Re: [BUG] git checkout <branch> allowed with uncommitted changes

From: Alexey Shumkin <hidden>
Date: 2016-06-15 22:52:15

Lucky you. :P  The most likely reason for me is, I'm working on
something and I get interrupted and have to switch. Since the code
may well not even compile at this point, the last thing I want to do
is commit it. 
"git stash" helps here
With Git you can/have_to/must change your SVN-based habits.
DO NOT BE AFRAID OF FREQUENT COMMITS!
There are local until you push them.
git's ability for that commit to be local is half the
reason I'm trying to switch to it.
You always have a chance to modify/reedit you commits
see "git commit --amend" and "git rebase [-i]"

I'm telling you it as an ex-SVN user.
(I'm not particularly keen on
having to commit broken code to even a local repo, but that's still a
hell of a lot better than having it pushed upstream as well).
Again, do not be afraid to commit your changes. Be afraid of losing
your changes. Git makes everything (as other discussion participants
already described) to keep your changes within workflow when you
switch between branches often.

Read some books which are describe Git's usual (and effective) workflow,
ProGit - http://progit.org/book/
Version Contol by Example (there is a chapter about Git) -
http://git-scm.com/course/svn.html

Hope, you'll feel the power of Git ))
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help