Do you have to install Git separately from GitHub for Mac? - github

I am a novice coder and I write a blog about learning to program aimed at journalists.
Learning the basics of how to use a version control system was one of the best things I learned this year, and I am now writing a tutorial about it.
Here is my question:
Do you have to install Git separately from Github's graphical client, GitHub for Mac? If it's possible to avoid command-line operations, I may choose to write the tutorial just focusing on downloading and installing GitHub for Mac and walking the user through the process of making new repos, forking, rolling back, etc.

Yes, if you want to do any git stuff on the command line, you'll need to install it. You'll especially want to do it because Github for Mac doesn't let you do everything you need to out of the box. For example you can't do a push without commit everything which can be annoying if you need to push a feature quickly without branching. Also, it is good for learnings!
You'll find an easy shortcut to install it under the "Github" menu: "Install Command Line Utility..."

You now can, (May 2013) install git directly from "GitHub for Mac"
See the blog "Installing Git from GitHub for Mac", you can install only the GUI, or the GUI and a regular git CLI (Command-Line Interface)
you can now easily install Git for use on the command line, without needing to download any separate packages.
When there is a new release of git, you don't have to do anything:
And whenever we update the version of Git included with GitHub for Mac, you'll get the changes automatically – no work required on your part!
There is a new "Advanced" option:
you may notice some changes to the Preferences window.
On the newly renamed "Advanced" tab, simply click "Install Command Line Tools".
You'll be prompted for an administrator password so that Git can be installed into /usr/local/bin, and then you should very shortly see that it succeeded:

Related

How to manage Django Project and its modules with git?

I've been looking for a solution how to manage my project with git for quite some time now. I want to have one instance as the main repo for connecting the entire project. Each app should be its own git instance.
During my search I found both git submodule and git subtree. For both tools I found an instruction how to insert an existing reppo. However, I am interested in how to proceed from the beginning. I mean here from the command $ django-admin startproject myproject Where do I enter the git init? When I create a new app
$ django-admin startapp new-app and how do I use this as subtree/submodule?
Until now I have always found instructions that refer to a remote repo. Is this always necessary? I am not sure if I want to publish every Django app on Github. But I want a version control system just for me. Is this possible?
I have to say that so far it has been enough to manage my "projects" locally. Now I want to work together with others and I don't want to install the whole Django Project locally but only provide me with single functions or modules.
It would be a great help if you could explain to me how that works.
TL;DR
How to manage (start and expand) a Django Project with git. The apps should be their own git repos.
The purpose of submodules is to allow you to graft an existing repo/library into your git. Rarely do you want to do this. Instead you want to use PIP tools to install your libraries as part of library management.
This is essentially a git question. If you don't have a remote repository, you can still use git. With that said, the reason you want a remote repository is so that you can collaborate with others, and have a stored version of the code separate from your workstation.
There are services that let you have private repos even without a paid account. Bitbucket is the most well known of these services and is comparable to Github in most ways.

How/What hostname do I use on my command line to access my Github?

I am new to command line and have no idea how to use. I have Putty command line and would like to connect to my GitHub. Putty asks for a "Hostnamne/IP address". I do not know what to insert so it can work. Could anyone please help me?
PuTTY isn't something that you would use to connect directly to GitHub. It is an SSH client, but you need a Git client. Since GitHub doesn't provide interactive SSH, PuTTY won't be of much use.
I'm going to assume you're on Windows since that's where PuTTY is most often used. You can install the latest official release of Git for Windows, but it's probably worth installing one of the recent 2.x prereleases instead. These will be the official versions very shortly.
Once you have Git installed you should be able to run "Git Bash", which will drop you into a command line. At this point you can use git clone to clone an existing repository, git init to create a brand new one, or any number of other things. You'll probably want to find a tutorial or read a book before going much further.
If you'd prefer a graphical Git client there are many options.

How to use GitHub for Windows 2.0 with non-GitHub repositories

I just installed (as opposed to update) GitHub for Windows 2.0 and for the life of me I cannot find how to use it with non-GitHub repositories. In the past I have done this without issues using this guide. However with version 2.0 the layout has changed and I cannot find a UI to clone a repo that is not from GitHub. I guess I have to drop to the command line but I have no idea how to use git that way.
As you suggested, you can clone the repository with Git on the command line. To do so you can execute the following steps:
Start the Git shell (Start menu->GitHub, Inc->Git Shell on Windows 7, I'm not familiar with Windows 8 but I think it will show up when you type "Git Shell" on the start screen)
Make sure you are in the GitHub directory (C:\users\\Documents\GitHub). Otherwise use the cd-command to navigate there.
Use the clone command git clone user#domain.com:/path/repository.git with the clone-url for the project you want to add. (More information about cloning)
Start GitHub for Windows and go to tools and options->Options
Click Scan for repositories, if everything went right your cloned project shows up.
Make sure it is selected and click Add

Can't commit with Github Windows, no reason given

I have been forced to use other apps, and the command line since Github for Windows is not allowing me to commit changes. I would like to understand what's the problem, but I simply get a prompt with this message:
Commit failed
Failed to create new commit
Then, it gives me the option of go to the Git Shell or to cancel. While I am not an expert with the terminal, I am able to make commits when I choose to go to the Git Shell (or to any other application for that matter).
I am using Github 2.0.5 on Windows 7.
After an exchange with the Github for Windows developers, the issue has something to do with Windows inability to work with paths when they're too long. The node_modules folders generated by Node.js is the culprit of this issue in my particular case.
However, the node_modules folders in my repository are gitignored. The fact that even when gitignored they create a problem in Github for Windows means the developers have to address the situation.
I expect a response or a patch from the developers soon. They have been very helpful. In the meantime, I am using SourceTree as my Windows Git GUI.

Can I have git gui and git bash and eclipse git plugin looking at same repo simultaneously?

I am using Eclipse to work on Android java projects on a Windows 7 machine. I am using Git to version-track, back up, and share.
I have git gui, git bash, and the eclipse git plug-in. My question really comes down to:
Is it safe and/or will my tools (gui, bash, eclipse) work right if I have them all open and looking at the same git repo at the same time?
I ask this because I have had eclipse fail to do a checkin a few times, and one time in git gui when it was barfing I got brave/stupid and hit the "unlock git index" choice. Since I did that unlock, none of my git clients have complained. But the suggestion that there IS a lock and that I "manually" unlocked it has me afraid that I have opened the door to non-thread safe crashes in my git repos.
TIA
Yes, it is safe. The index lock is something that is normally only intended to be held while an operation is in progress (e.g. while a commit is being created or a merge is being handled).
If you have to manually unlock the index it probably means one of your Git clients crashed/errored while it was doing one of those operations and thus accidentally left it locked.