簡體   English   中英

Mac 上的 Git 設置(錯誤:“-bash: git: command not found”)

[英]Git setup on mac (ERROR: "-bash: git: command not found")

我正在嘗試通過此鏈接( http://help.github.com/mac-set-up-git/ )在我的 Mac 上設置 git。 在第 5 步之前我是成功的,我確實看到了消息Hi kharagpur! You've successfully authenticated, but GitHub does not provide shell access. Hi kharagpur! You've successfully authenticated, but GitHub does not provide shell access.

當我嘗試下一步(“然后:設置您的信息”)時,我遇到了問題-bash: git: command not found when I want to execute git config --global user.name "Firstname Lastname"

我正在從用戶/(myusername)/執行這一行

我的主要目標是設置 github 並將項目從 repo 拉到我的本地計算機,以便我可以使用 Eclipse 進行編碼。

任何幫助表示贊賞並提前感謝您。

聽起來你沒有安裝git。

這對我有用(MacOSX Lion):

獲取安裝程序:

curl -O http://git-osx-installer.googlecode.com/files/git-1.7.9.1-intel-universal-snow-leopard.dmg

山:

hdiutil attach ./git-1.7.9.1-intel-universal-snow-leopard.dmg

安裝:

sudo installer -pkg /Volumes/Git\ 1.7.9.1\ Snow\ Leopard\ Intel\ Universal/git-1.7.9.1-intel-universal-snow-leopard.pkg -target /

卸載:

hdiutil detach /Volumes/Git\ 1.7.9.1\ Snow\ Leopard\ Intel\ Universal/

清理:

rm git-1.7.9.1-intel-universal-snow-leopard.dmg

請安裝 Homebrew - 最好的 Mac 包管理器

關聯

按照此處的說明進行操作 - 您也將需要來自 Apple 的命令行工具。 Homebrew 將讓您看到許多其他軟件包 - 只需安裝 PHP / MySQL / Node / Mongo 等

brew install git brew install 很多其他有用的東西

然后你可以

釀造更新....

簡單——值得花時間去探索。

你應該從這里獲得 github for mac 工具 - http://mac.github.com/

它應該允許您非常輕松地管理存儲庫,以及提交、同步操作。 關於您遇到的錯誤,這無關緊要。 嘗試從終端連接到您的 git 帳戶,看看您是否能夠連接它。 只要它工作正常,它應該沒問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM