I'm a .NET developer and I've used TFS (team foundation server) as my source control software many times. Good features of TFS are:

Good integration with Visual Studio (so I do almost everything visually; no console commands)

Easy check-out, check-in process

Easy merging and conflict resolution

Easy automated builds

Branching

Now, I want to use Git as the backbone, repository, and source control of my open source projects. My projects are in C#, JavaScript, or PHP language with MySQL, or SQL Server databases as the storage mechanism.

I just used github.com's help for this purpose and I created a profile there, and downloaded a GUI for Git. Up to this part was so easy.

But I'm almost stuck at going along any further. I just want to do some simple (really simple) operations, including:

Creating a project on Git and mapping it to a folder on my laptop

Checking out/checking in files and folders

Resolving conflicts

That's all I need to do now. But it seems that the GUI is not that user friendly. I expect the GUI to have a Connect To... or something like that, and then I expect a list of projects to be shown, and when I choose one, I expect to see the list of files and folders of that project, just like exploring your TFS project in Visual Studio. Then I want to be able to right click a file and select check-in... or check-out and stuff like that.

Do I expect much? What should I do to easily use Git just like TFS? What am I missing here?

I switched from SVN to git one year ago, and I'm very happy about it. I would NOT recommend SVN to anybody except to a rigid command line hater. Once you learn git, you'll love it.
–
maaartinusOct 15 '11 at 12:25

13

Why is it that windows folks are so obsessed about graphical interfaces?
–
tdammersOct 15 '11 at 15:57

7

@tdammers Because command line on Windows sucks like hell? I know, there's PowerShell, but do they use it?
–
maaartinusOct 15 '11 at 16:20

2

@Saeed, for a start, you're expecting that there's any such thing as checking files in and out in git. No usable VCS has had that for years.
–
Daniel RosemanOct 15 '11 at 17:18

9 Answers
9

The advantages git has come from tossing out a lot of old assumptions about what a VCS should do. The disadvantages git has come from not being able to leverage prior experience and not being able to do things the way you are used to.

If you are going to switch from something else to git, try to start tabula-rasa (though it is impossible to truly do in practice). Evaluate it based on what it does and how well it does it, not on how it does it compared to how you are used to doing it. It's not that you expect too much, it's that your expectations are orthogonal to what git provides. If you're married to GUI operation, you'll be disappointed. Git does have gui tools available, but they don't add much. That's not a failure to provide them so much as there isn't that much that a gui can add. GitK does help, not in day-to-day operations, but rather in visualizing the branch structure and examining or searching history.

Here's a goofy analogy for what I mean by "orthogonal". One of the things you can do with a newspaper is wrap fish in it, or use it to line a birdcage. But those are not essential to the function of a newspaper, those are incidental features of the form it comes in. Expecting git to "check in files", or "allow you to select projects", or provide a "connect to..." is kind of like expecting to be able to wrap fish or line your birdcage with a newspaper's website.

Have you considered mercurial? Like git, it is a DCVS and lets you do all the neat things one can do with a DCVS. Like git there is a pretty good, cloud-based service provider (bitbucket). But, unlike git, the windows story is pretty decent, you are not a 2nd class citizen. You've got good tooling options (TortiseHG) and pretty decent Visual Studio integration (VisualHG).

Nothing is going to be like TFS in visual studio though -- the world just isn't wired that way.

I'd agree, a few years ago I moved from VSS to Mercurial and it was a real epiphany. Suddenly I could do things I never thought would be practical. Then I moved to svn and missed lots of things which were just so easy in hg. Now I'm moving to git and have mixed feelings. I love getting back many of those facilities I missed in svn, but I still miss the simplicity of hg compared to the unnecessary complexity of git. Even just installing TortoiseGit on windows requires you to jump through hoops that simply aren't necessary with TortoiseHg.
–
Mark BoothOct 17 '11 at 16:38

@Mark Booth: I'd agree that git is not very user-friendly, but what unnecessary complexity? Installation problems do not count, they could be attributed to TortoiseGit (which is a different program) or to Windows.
–
maaartinusOct 18 '11 at 20:39

This would be better off on chat, but I see no need whatsoever for the index/cache/staging area, IMHO the default should be to commit everything with the option of partial commits if requested (better still would be to shelve the changes you don't want immediately , re-run your unit tests, commit and then unshelve). I also hate having to explicitly create a new branch when I want one. With hg an unnamed branch is created silently whenever you commit to a non head. In git, if you move away from a head without branching you can potentially lose it and then have it garbage collected!
–
Mark BoothOct 19 '11 at 11:15

I switched from SVN to git one year ago, and I'm very happy about it. However, I'm not relying on any GUI and in case you rigidly refuse command line it may be a problem.

You seem to expect git to work the way you're used to, but it doesn't. It's not hard, but you should take a look at its principles before you proceed.

Creating a project on Git and mapping it to a folder on my laptop

Git is distributed, which means you always work with your local repository, which may be mapped to any number of remotes, including zero. When playing with other's project I'm using two remotes: their git or SVN repository and my own server.

I always start by creating an empty directory and then either git init or git clone SOME-REMOTE-REPOSITORY. This link could help you.

Checking out/checking in files and folders

You missed to write what GUI you're using. Both TortoiseGit and git-gui surely can do it.

Resolving conflicts

For this I'm using git-gui or my favorite text editor.

I expect the GUI to have a Connect To... or something like that

Connect to what, when there may be 0 to N remotes? Git doesn't stay connected to a remote server, it creates the connection only temporarily and only for the few commands working with the remote repository. Most of the work gets done locally.

then I expect a list of projects to be shown

I'm assuming by projects you mean repositories.

I'm afraid there's no such thing. Git on a remote server works strictly with one repository only. Listing all repositories is equivalent to listing all directories containing the subdirectory .git. I'm sure there's something like this on GitHub.

I choose one, I expect to see the list of files and folders of that project, just like exploring

Again, I'm afraid there's no such thing, since git works locally. And again, it wouldn't be of much use. Simply clone the repository and explore it on your computer. While cloning of huge repos takes some time, all subsequent operations are much faster, and you may look at any commit or branch.

Then I want to be able to right click a file and select check-in... or check-out and stuff like that.

Again, git works locally. So it makes no sense to check-in or check-out to a remote repo. Working this way is a waste of time even on a fast LAN. Get the repository to your computer, work with it and git push the changes to the remote. Think about it like about publishing your changes and also making backup. You should commit locally very often.

Before you start your work, git fetch or git pull the changes from the remote in case somebody else may have been working with it.

Do I expect much?

Yes and no. You expect something different from what it offers. You can get something much better, git is powerful, flexible, safe, fast like hell, and can do everything you need, but it can't mimic exactly what a centralized VCS does.

Going from vss to tfs was a pleasant experience.
Going from tfs to svn was a pleasant experience.
Going from svn to git has been sort of an internal battle.

Often I find myself to be quite conservative and I try to hang on to what works.
A nice gui is for me preferable over the command line and I found myself searching for some gui that would let me play with the cool kids I work with. They all used git with the command line exclusively.

The eureka moment for me came once I gave up on the search for a silver bullet gui and started to give git bash a try (I'm still learning).

I have some guis installed and they do complement git from the command line.
Git extensions, Git source control provider for visual studio and tortoise git.
But I say get familiar with git bash.
The commands can be a little cryptic but once you learn them they are so much faster than the gui.

Branching with git is just AWESOME compared to the others.
Create branches and switching between branches it almost instant.
You can do stuff you would not bother doing with svn because svn basically copies your working copy (at least the way I did it).

I find Git to have a steeper learning curve than svn.
But once you "get it" with git you don't want to go back.

You're used to having a server which stores your files and is the omnipotent owner of them. To edit a file you must ask for permission from the server.

Git is not like that. Think of git this way: you have your local repository. Git lets you commit changes, reverse commits, easy and quick branching, etc.
When you want to backup your source-control history, you push your changes to another repository, which "just happens to be" a server, like GitHub.com.

Workflow:

Clone(Download)/Create repository

Make some changes. Continue with development without caring about others.

Push to another repository (could be a server like GitHub).

When you push to a repository, that other repository's owner is notified of the pending push, and must decide whether to accept those commits, decline them, or only take a subset of them.

What do you mean, "the" git gui? There are a gazillion of them, including a plugin for visual studio integration, if I remember correctly. If one GUI doesn't work for you, try some more until you find one that does. I personally use different GUIs for different tasks (and the CLI for others).

However, git is more of a version control framework than a fixed system. You're still going to have to learn some basics to get the most out of it.

+1 Checking them directly from a remote server simply makes no sense. It's just to slow, even over LAN. Doing such things is something FTP is for, not VCS.
–
maaartinusOct 15 '11 at 13:50

"Checking in/out" files is not a fundamental operation for a VCS. It is an implementation feature common to most VCSs, and one that has subtle but unfortunate side-effects.
–
kylbenOct 15 '11 at 14:03

@snorfus - I answered on "I expect the GUI to have a..." part
–
Lazy BadgerOct 15 '11 at 14:29

2

@kylben: checking in/out is one way to look at version control; editing-and-merge is another way. Some VCS's use the former approach, giving you exclusive locks and the ability to check out individual files; others take the latter, and with those, you download the entire repository, make your local changes, and then push them back to the remote; the VCS takes care of managing conflicting changes, asking for your input in case of doubt. Neither approach is better, but you can't usually bend a VCS into the one it hasn't been made for.
–
tdammersOct 15 '11 at 15:56