Re: [BUG] git checkout <branch> allowed with uncommitted changes
- From
Alexey Shumkin <alex.crezoff@gmail.com>
- Date
- Oct 14, 2011, 06:51 UTC
- Message-ID
- <20111014105116.1e5afa5d@ashu.dyn.rarus.ru>
- In-Reply-To
- <20111013201711.3d55c693@ashu.dyn.rarus.ru>
Show 28 quoted lines
> > 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
oops, wrong url
fixed link Version Contol by Example (there is a chapter about Git) - http://www.ericsink.com/vcbe/