Foray into git

We’ve recently migrated from TFS to git. I’m an svn girl at heart, so it’s all a bit new and strange.

So far, it’s been a big learning curve. The Git – SVN Crash Course has been really useful. Things I have learned today:

  • I do not understand git rebase
  • I do not understand git reset
  • NEVER play with things you don’t understand
  • Commit often (minutes, not hours)
  • git reflog is your friend
  • We’re still not sure how it happened, but my local branch went missing. Thanks to @ciaran_j I did a git reflog and in there I found my commit logs! I was able to check out to the specified hash and then do a merge. Phew.

    Disaster averted.

    2 thoughts on “Foray into git

    1. From what I’ve seen, git rebase is *usually* wrapped up in the calls you make elsewhere, so (if I remember rightly) things like git pull does a fetch of updates, and then rebases the local repo – in other words, applies all your unmerged diffs against the stuff you pulled from the shared repo.

      git reset is like checking out a specific version point, usually seems like it’s used to checkout the last checked in version.

      Of course, I might be wrong, I’m still a novice in this game too!

    2. I’d ammend that myself to;

      Commit often, commit early, and definitely *DO* play with stuff you don’t understand.

      As long as you’ve committed you’ll be able to fix 90% of the things you can do with Git. There are of course exceptions, if you’ve wandered into the .git sub-folder, or you’re using one of the more raw commands, then yes you can cause problems.

      But the only way to learn git is to make the mistakes and figure your way out of them 😉 .. personally I found it quite a brutal learning curve, but worth it 🙂

    What did you think?

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google photo

    You are commenting using your Google account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s