Live data from Hacker News

Git Tips And Workflows

durdn.com

31–40 of 40 posts

Re: Git Tips And Workflows

#32
post #12

Has anybody seen a "git for people who have no idea how to use git" tutorial? I use git for keeping track of some personal projects, but the extent to which I understand how to use it is: "git commit origin master" We had a hackathon this weekend, and our team had three people on it. I wanted to make it so that they could also commit code into the same repo (I think this it the right term?), but had absolutely no ide…

http://gitimmersion.com/ - This is a lab taking you through everything. I found it very helpful when introducing Git to my team mates who had little to no experience with source control.

It's a bit light on concepts but is fairly practical.

Re: Git Tips And Workflows

#34
>> Making a more recent branch the new master

Why don't just use "git reset --hard "?

At least if the better-branch and master commit in common is the last commit in master so no history rewrite will happen when pushing.

Re: Git Tips And Workflows

#35
These seem like the kind of things you'd end up using once in a blue moon. No point in memorizing them.

Am I alone in using git extensions? I've been very happy with it and its ability to display git's "state" right in the window. I usually have one monitor with VS and one with GitExtentions

Re: Git Tips And Workflows

#36

> Making ‘git diff’ wrap long lines ... My git diff would not wrap lines and leave a lot of information hidden from view in my terminal. Git is so ... stone age!

I think for git diff, this "no wrapping" is a feature not a bug. Git is made for code in general and Linux (as in, the kernel codebase) in particular. If your lines are long enough or your terminal is narrow enough that you need lines to be wrapped, then it may be that your lines are getting too long. The Linux coding style mandates limiting lines to 80 characters and breaking up lines which are longer than this limit. This may seem arbitrary and may not be a great idea in a language which isn't C, but for Linux, this limit allows levels of indentation which are too deep to be more easily seen because when code gets into too many levels of indentation it will become very obvious because several statements end up split across lines. Beyond that, Linus prefers to chop lines over wrapping, and it seems he just put his personal preference into his tool because it isn't that big a deal.

Re: Git Tips And Workflows

#37
post #12

Has anybody seen a "git for people who have no idea how to use git" tutorial? I use git for keeping track of some personal projects, but the extent to which I understand how to use it is: "git commit origin master" We had a hackathon this weekend, and our team had three people on it. I wanted to make it so that they could also commit code into the same repo (I think this it the right term?), but had absolutely no ide…

I gave a two hour talk on git, starting from the ground up: https://speakerdeck.com/rmccue/introduction-to-git-plus-usin...

Still working on getting the videos up, but the slides should give a little bit of an introduction, albeit slightly confusing without the speaking.

Re: Git Tips And Workflows

#40

Earlier quoted context omitted.

Use SVN. There's lack of "svn for people who have no idea how to use svn" tutorials, and when they're published, they tend to be single-paragraph. I'm not sure git is a perfect solution for any project. Unless you intend to pull each other's modifications, the idea of a central "trunk" and custom "branches" is easy to explain to anybody in 5 minutes.

Isn't pulling each others modifications kind of the point of VCS?

No, most of the time you want to pull from trunk, which everybody agrees on is the most current version, not feature A from Alice, and feature B from Bob and see where you end up.
Post reply on HN