Viki
Viki

Reputation: 421

How to open the git terminal on mac?

I've installed git in /usr/local on my mac from http://git-scm.com/download/mac but I'm confused about how to open the terminal.

Upvotes: 8

Views: 121301

Answers (5)

user13558818
user13558818

Reputation:

I use Windows, where Git bash is the application that I use to use git commands. On my mac, however, the Terminal application is used for Git commands like Git Bash on Windows. I was a bit confused as to why I could not find a Git Bash version for Mac anywhere on Git's site. It turns out that Git commands are all executed in the Mac terminal application, Terminal. As said above, first check that you have installed Git correctly with running this in the Terminal:

git --version

And then if a recent version of git is spat out from the Terminal, then you can start using normal git commands like how one would use in Git Bash, like these:

git clone YOUR_REPOSITORY

or

git checkout OTHER_BRANCH

I hope that this helped.

Upvotes: 3

Yilmaz
Yilmaz

Reputation: 49361

Bash is shell. In mac you already got Bash but in windows you get Bash when you install git. So in mac you will use terminal for your git, but in windows you get separate git terminal. I think that's why you are confused.

when you type

git --version

if u see it is already installed so you are ready to use the git in your terminal

Upvotes: 9

Shannon Chou
Shannon Chou

Reputation: 1457

I strongly recommend you use Homebrew to install git.

  1. install Homebrew
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. install git last stable version.
    brew install git

  3. open system terminal (the Mac OS build-in terminal)

  4. run git --version, You will see It!

About Homebrew.

Upvotes: 3

Droppy
Droppy

Reputation: 9721

It sounds like you have not performed steps 2 and 3 from the README.txt file:

Step 2 - Remove stubs

In later versions of OS X (Yosemite and onward), you'll probably see a message like the following:

'The "git" command requires the command line developer
tools. Would you like to install the tools now?"

This is because OS X has started to ship with stubs; in order to stay nice and easy-to-uninstall, the git installer places all of it's assets under /usr/local/git. As a result, the git in /usr/local/git/bin/git takes second place to /usr/bin/git.

sudo mv /usr/bin/git /usr/bin/git-system

Step 3 - Restart bash sessions

This include GNU screen sessions, TMUX sessions, etc. If you wish to preserve your precious screen session, just source /etc/profile.

Upvotes: 0

Hexana
Hexana

Reputation: 1135

On your command line, type "git" then cd to the directory where your project resides.

Upvotes: -2

Related Questions