-4

I just got a Mac, and one day it suddenly occured to me: This would be great for coding.

Because I didn't want the 4GB Xcode developer tools (or indeed knew git was included with them) I downloaded Git directly from their website. The installation went successfully, but now I don't know where it is and how to use it.

How do you use Git for Mac?

peterh
  • 11,875
  • 18
  • 85
  • 108
FirePenguin
  • 169
  • 5
  • Possible duplicate of [Locate Git installation folder on Mac OS X](//stackoverflow.com/q/3623739) – 4castle Nov 22 '17 at 05:52
  • As for how to use it, you should use a tutorial, or type `git help` in your command line. – 4castle Nov 22 '17 at 05:54
  • I've never used XCode, but if it's anything like other IDEs, it probably has a plugin for Git. You may need to download this plugin just as you had to download Git. You may use Git from the command line, or from within an IDE, it's really a matter of personal preference. – Tim Biegeleisen Nov 22 '17 at 05:55
  • Does it show up if you type `git` on the commandline? Remember, basic `git` is a commandline tool. 'Visual' git tools are usually third party software or plugins. – roelofs Nov 22 '17 at 05:59
  • To all who have suggested the command line: Thanks for your comments, but when I try using the Git function, it asks me to install Xcode. – FirePenguin Nov 22 '17 at 06:07
  • Possible duplicate of [Locate Git installation folder on Mac OS X](https://stackoverflow.com/questions/3623739/locate-git-installation-folder-on-mac-os-x) – iamdanchiv Nov 22 '17 at 06:14

2 Answers2

0

Check if it is install in your machine. Go to /usr/bin/ "git" command should be there if it is installed. if not follow the step with URL - https://www.atlassian.com/git/tutorials/install-git

-2

If you want to use the git you need to setup ssh keys - Follow the step

  1. Open Terminal
  2. Run command - ssh-keygen -t rsa -b 4096 -C "your_email@domain.com"
    This creates a new ssh key, using the provided email as a label.
    "Generating public/private rsa key pair."

    1. Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]

    2. Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
      NOTE :- Most developers don't leave this blank, This will be the password to open/decrypt your key file

    3. Run command - pbcopy < ~/.ssh/id_rsa.pub
      This will copy the content of id_rsa.pub to clipboard

    4. Open you github account and click on the right top profile icon then select "Settings"

    5. Choose SSH and GPG keys

    6. Click in green color on top right - "New SSH key"
    7. Give a title (name/alias of the key)and paste the clipboard content you copied in step 5 to key section.
JimHawkins
  • 4,843
  • 8
  • 35
  • 55
  • My current problem is that the command "git" doesn't work, not that it doesn't work with GitHub, GitLab, Launchpad, or anything else. – FirePenguin Nov 22 '17 at 06:09
  • Check at location git command need to be available -/usr/bin/git If git command is there at the above location and still it is not working the then add the above path to environment variable. (/etc/paths) – Surendra Patel Dec 30 '18 at 10:02