5

Very noob question. I started using git/github for my classes in Python, but I dont see why is it any better than google drive or onedrive, since you can also send multiple archives and have it synced to your computer without having to "push". Why is it so popular and needed?

Comments
  • 1
    @Haxk20 I see. That makes sense! Thank you for your answer. Only one last doubt, it is possible to return to last versions of the code? Like if something fucks up on version 6 can I push version 5 or even an older one through git?
  • 1
    @arthurolga yes, that is one of the better features of git
  • 0
  • 3
    one thing though. Git is not GitHub
  • 1
    @arthurolga Of course you can do that. Just revert the last commit.
  • 2
    Git's learning curve is basically a cliff (less so than vi), but it is so absolutely worth it.

    Git is amazing!
  • 1
    There is history as other have said (you can get back to litteraly ANY commit you made), but there is also merging : Git is able to auto-merge most of the code, and will sensibly ask you to resolve a merge only when it's not obvious.
    The "Drives" will choke on any merge, or just keep the most recent version, which is not always the correct anwer.

    A very nice side-effect is that it forces you to review your changes before commiting. I can say I did catch quite a lot of bugs that way.
  • 2
    Git basically creates a snapshot of every change you make (only the bits that have changed which is called a delta).

    The main group is called master but you can create more groups (called branches) of isolated changes which you can merge back into the main one at a later date.
  • 0
    Okay, This is how git can save your ass ->
    A: I finished coding this part, I tested this feature and it works.
    B: Okay cool, let's merge your changed. (some few typo and Boom!, Your code base is now update)
    Some later on...
    A: oh, it has some bug, let me fix it real quick(create another branch).
    B: fine, I dont finish mine yet.(leave it to A and B stil doing his works)
    A: Im done.
    B: Mine feature too, lets merge it and call it a day. (few typo, Boom! update)
    Now compare to GDrive
    A: I finished my feature, let see my drive.
    B: okay time to merge change, let's open his file and mine to see what code he changed and copy/paste to mine. (fuck he change 20 file, this is gonna take long)
    A: Oh, their is a bug. Lets fix it.
    B: Wait, Im not done yet.
    A: Nah.. we'll merge again.
    B: Wait what is the lastet version?
    A: Nah..let me fix it first.
    B: How u gonna make it if you dont track my change?
    ..............................
    Btw, git make you easily roll back your work. (fuck....., char limit)
  • 0
    Or this one->
    A: Im working on featue A.
    Boss: fix our version 1 stable bug.
    A: Create hotfix branch, fixed, commit, push, release hot fix
    A: merge hotfix back to develop.
    A: checkout feature he currently working, rebase develop and continue flawlessly.
Add Comment