I’m trying to use Git for the first time.
I did everything that github instructions said to do, but when I got to:
git push -u origin master
I typed:
/Users/name/Documents/Xcode.app/Contents/Developer/usr/bin/git push -u origin master
And got the error:
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
I also tried to set my git path to the above since it says git isn’t found, but the path didn’t work. So I’ve just been typing the whole thing out. When I did sudo find / -name git, it came up with the above directory for git, and also some other directories that I wasn’t sure about, such as
- /Applications/Xcode.app/Contents/Developer/usr/bin/git
- /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git
- /Applications/Xcode.app/Contents/Developer/usr/share/git-core/python/git_remote_helpers/git
- /Users/name/Documents/Xcode.app/Contents/Developer/usr/share/git-core/python/git_remote_helpers/git
and the one that I used:
- /Users/name/Documents/Xcode.app/Contents/Developer/usr/bin/git
I saw that all of the other commands to set up a git repository seemed to work ok.
Other commands to set up included
mkdir fbPic2
cd fbPic2
<path to git>/git init
touch README
<path to git>/git add README
<path to git>/git commit -m 'first commit'
<path to git>/git remote add origin git@github.com:michcleary/fbPic2.git
<path to git>/git push -u origin master #didn't work
I tried to look for .git/config but can’t find it.
I hope someone out there knows about this. It says that I need to get Git installed to do a Facebook app in the tutorial. I have a Mac Mini with Lion installed.
Absolute first step is to get Xcode to install the ‘command line tools’. Doing that will get the tools into /usr/bin – which is already in your PATH. Go to “Xcode” :: “Preferences” :: “Downloads” :: “Components” where there should be an install “Command Line Tools”. If there isn’t, go to “Xcode” :: “Open Developer Tool” :: “More Developer Tools” and download the most recent command line tools. Now, ‘git’ will be in your path. Should also be that ‘git help ‘ works too!
Now configure git with (as suggested by @johnsyweb):
and for GitHub:
where you will need to follow the GitHub directions to get your token. You’ll also need to carefully follow the GitHub SSH instructions.
After the above ‘git config’ commands you will have a ~/.gitconfig file ready to go.
Presumably you have created a GitHub repository already. If not, you must. [It doesn’t look like you have a public repository yet.] After creating one, the easiest approach to getting a local repository setup is simply:
Done!