Join Kevin Skoglund for an in-depth discussion in this video Exploring graphical user interfaces, part of Git Essential Training.
All the interaction we've done with Git so far we've done from the command line, and that really is where Git sort of lives, and it's the best place for you to get started as a beginner and get familiar with those commands. However, some people find that after they've had experience with the basics and they're familiar with the command line, they find that they can actually speed up their workflow by incorporating a graphical user-interface to help them to see the state of the Git project and actually work with Git by using a graphical user-interface instead of typing.
There are number of options available to you for this. The first and simplest is just GitWeb. GitWeb is included with Git. You need to actually set up a web server to be able to do this, so it does requires some amount of technical knowledge, because you do need to be able to set up the web server to host it, but what it does is it let's you see your get repository as a little mini web site. Now that's a pretty basic and limited way of doing it, but it is on the web where it's available for everyone to be able to see which is kind of nice. And on a more personal level though you will probably going to be more interested in a graphical user-interface application that you can download onto your computer.
Let's start by looking at a few of the most popular ones for the Mac. GitX is probably one of the oldest ones, it's been around the longest, GitHub of course we know is the hosting company, they also offer a application client that you can download and use. Now I'll give you a peek at GitX and GitHub just so you get an idea of what a graphical user-interface can do for you. But before we do that let also look at the list of Windows applications. So if you're on Windows, you'll probably want to look at one of these, these are the most popular ones. And again you'll see the GitHub is in that list with their Windows client, and SmartGit actually has one for both, they are cross- platform they offer it for both Mac and for Windows.
Like I said, there are many, many of these and new ones are appearing all the time. There is actually a pretty good list maintained on the Git Wiki, so if you go to git.wiki.kernel.org/index.php/ InterfacesFrontendsAndTools with caps in there, and it'll give you a list of all the different interfaces, front-ends, and tools that are available to you. Based on the popularity of the choices that I showed you earlier though, you probably won't need to go to this very exhaustive list. Let me can give you an idea of what a graphical user-interface can do for you.
So this is GitX, and you can see here that it's showing me this kind of graphical view that I was looking at from the command line, its a little nicer looking here. If I click on any one of these edits, you'll see that it shows me down here what the edit actually looks like, I can switch to look at different branches. I'm on master now, but I can switch and take a look at non-tracking, seo-title, shorten_title, see what those all look like, and I can look at my remotes and see the state of things there. I also have the ability to stage in my commits here. It'll give me a list of all the files that have changed right here, I can select them, and I'll move them over here to the stage changes side.
And then when I'm ready, I can write a commit message and actually do the commit from here as well. Up here this area just shows you the different changes, so you can review them. So as you click on the different files you can review the changes before you stage them and then commit them. Now it's got lots of other features but that does give you an idea of how you're able to see your repository and interact with it from a graphical user-interface. Let's take a look now at GitHub. This is the GitHub Mac client, so here once again, we can see all the different commits I've made. This is essentially my log, the history, if I want to view information about one of those I can just click on the arrow here, it'll take me to more information about it. I can revert the commit from here, go back to my history again.
The changes I can also make from here, uncommitted changes, this is to let me put in my commit message, and then I can select the files that I want to stage and then add with commit, and this is the file viewer over here where I can watch those. I've also got branches here where I can see all the different branches, and I can even go up here to Repository, I can do things like switch branch if I want to quickly just change to my non-tracking branch, now I'm on the non-tracking branch. I don't actually have to check it out, it does it for me just like that. All these graphical user-interfaces all have a different look to them, a different sense of what's important, and probably you'll need to try three or four of them until you find one this sort of feels right to you, but again, as a beginner, I think it's important not to become too dependent on these graphical user interface tools. You want to make sure that your command line knowledge is still solid before you start using them to speed things up for yourself.
- Exploring the history of version control
- Installing Git on Mac, Windows, and Linux
- Initializing a repository
- Writing useful commit messages
- Understanding the Git three-tree architecture
- Tracking when files are added, edited, deleted, or moved
- Viewing change sets and comparing versions
- Undoing changes and rolling back to previous versions
- Ignoring changes to select files
- Creating and working with code branches
- Merging branches and resolving merge conflicts
- Stashing changes for later
- Working with hosted repositories and remote branches
- Developing an effective collaboration workflow
Skill Level Beginner
Q: In the Chapter 10 movie "Configuring the command prompt to show the branch," when I type the function "__git_ps1," I do not get the expected result.
A: The function "__git_ps1" was recently moved to a new file, .git-prompt.sh, as described here: https://github.com/git/git/commit/af31a456b4cd38f2630ed8e556e23954f806a3cc.
We will update the video. In the meantime, you may do the same steps you do for .git-completion.bash, but a second time using ".git-prompt.sh" as shown here: https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh.
Q: When I use the code the instructor advises in the above video ("git config --global user.name "Nelda Street"), I still get an "Illegal Instruction" error. I have OS 10.6.8. Am I doing something wrong?
A: The current installer version of git isn't compatible with older Mac OS versions.
1. To add "-mmacosx-version-min=10.6" as described here:https://stackoverflow.com/questions/14268887/what-is-the-illegal-instruction-4-error-and-why-does-mmacosx-version-min-10https://stackoverflow.com/questions/10177038/illegal-instruction-4-shows-up-in-os-x-lion
2. Or to use the version of git that comes with Xcode, or to use homebrew to install git instead.http://superuser.com/questions/697144/installed-git-not-sure-how-to-get-it-working