Welcome, Guest. Please login or register.


Author Topic: Do you know Git? If not, you should ;) (Read 646 times)

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Chrome 46.0.2490.80 Chrome 46.0.2490.80
    • View Profile
Do you know Git? If not, you should ;)
« on: 2015.November.17. 17:56:24 »
[I'm writing this mainly because of the devCompo...]

I think that many of you are programmers by profession and so you know git and what a great tool it is. However there may be people here not familiar with version control and how it simplifies the way you try/implement changes to your projects. And you can document all your changes/development steps through your commit messages and read the story through git log ;). And it seems you can always undo if you mess up.

I first got to learn and use git about half a year ago and now I can't imagine coding without it ;P. It's the greatest tool I have ever came to use. So powerful...

Here's a link to an interactive git course at codecademy:
https://www.codecademy.com/learn/learn-git
Note that the last part is obsolete for individual projects.
However they don't mention a few commands which (at least myself) use very often:
git checkout -b
git stash (git stash apply/drop/list/pop)
git rebase (they base the course on git merge which I try to avoid :oops: because I feel I could mess up and have to repair)
git reflog (well I mess up sometimes...because maybe I stash too often ;P)
There should be many other interactive couses, but the one at codecademy is the only one I've tries...:
https://try.github.io/levels/1/challenges/1
https://www.codeschool.com/courses/git-real

Offline lgb

  • EP addict
  • *
  • Posts: 3496
  • Country: hu
  • æðsta yfirmaður
  • OS:
  • Linux (Ubuntu) Linux (Ubuntu)
  • Browser:
  • Firefox 42.0 Firefox 42.0
    • View Profile
    • http://lgb.hu/
Re: Do you know Git? If not, you should ;)
« Reply #1 on: 2015.November.17. 20:01:03 »
I am big fan of revision control systems, I've used CVS, SVN (Subversion) and recently GIT too. However the true value of these systems can be seen in group work, especially with distributed version control systems (like GIT is, though there are more maybe less known stuffs, eg Hg - Mercurial). I don't say it's not useful otherwise, for example you can browse versions in the past, commits, difference, whatever, helps debugging (ie the bisecting to search the first wrong version between two revisions with log-search), branches, etc. But I am a bit uncertain how useful for a single programmer especially if he is not used to use it. But as far as I can remember my first steps in these systems they felt so "unneeded" and "how much easier to just edit files on my hdd, that's all" :) I just want to say, that indeed it worth to try to learn them/it, and try to use even if it feels "alien" at first :)

Offline ssr86

  • EP user
  • *
  • Posts: 359
  • Country: pl
  • OS:
  • Windows NT 6.2 Windows NT 6.2
  • Browser:
  • Firefox 42.0 Firefox 42.0
    • View Profile
Re: Do you know Git? If not, you should ;)
« Reply #2 on: 2015.November.17. 20:21:50 »
Well in "single user mode" I value the possibility to write the project history through the commit messages... Maybe not that important but it should be fun to look after a long time in the git log (well I tend to write long commit messages... also at work ;P because I like to know what I changed/added to the project - looking at one-liners doesn't tell me much).
Also if I want to try an optimization/refactor of many files but don't know if I'll succeed. Then I do it in steps in different commits and at the end "merge" them together (if I succeed). And if I later have another idea I can backtrack a few commits and do changes from that - it's easier to find the right commit, then it would be to find the right folder - especially as I'm a "messy" programmer that forgets to comment his code... but I'm trying to get "cleaner".

However...yeah, maybe I could just use many copies of the project folder... but it's more "clean" using git and branches, I think.