4 ms·
Git has some learning curve, since you have to discard your notions of Svn, and learn how Git models a repository. But once you grasp that, it's pretty easy, n
by iamwil 18y ago
Git has some learning curve, since you have to discard your notions of Svn, and learn how Git models a repository.
But once you grasp that, it's pretty easy, not to mention pretty powerful. For me, Git had certain features that gave me a "wow", as I learned about and got use to using them:
1) Local branching - branching is fast, and merging is relatively painless. This lets you experiment with things without affecting the main branch. Branches are like 'tabs' on my browser, but for my source control.
git checkout -b experimental_branch
2) Staging commits - You can fix little things that might not have to do with your current ticket, but add them to separate commits. You can do even split edits done to the same file to two different commits.
git add -i
3) Rebasing branches - You can move the root of the local branch if you want the changes since then. Even better, you can reorder the commits as long as you haven't pushed it to a remote repository yet. The same task allows you to squash your commits together for a cleaner history.
git rebase -i
4) Stashing changes - You can stash uncommitted changes, so that you can perform other operations that require no uncommitted changes. This is useful when you're working on something, but can't commit it to your local branch yet, and something needs fixing on production right now.
git stash
Basically, a lot of what Git enables me to do is switch between tasks easily.
- tdavis 18y agoBasically, a lot of what Git enables me to do is switch between tasks easily. As a single developer, I love this about git. Being able to instantly create a new local branch to work on something, even if I only have an hour or two to devote to it, then switching branches and continuing on with the next important task is awesome. At least for me, it basically encourages exploration and testing new ideas because it takes no time and I know the "real" code is still safe and accessible instantly.