简体   繁体   English

-bash: create: 在 Git 上“创建”和“添加”时找不到命令

[英]-bash: create: command not found when 'create' and 'add' on Git

I followed all the instructions for installing git and the command line tools on Mac, but when I try to $ create and $ add files , -bash: create: command not found returns .我按照在 Mac 上安装 git 和命令行工具的所有说明进行操作,但是当我尝试$ create$ add files-bash: create: command not found returns

I also typed $ echo 'export PATH=/usr/local/git/bin:$PATH' >> ~/.profile to add to path, but it still returns command not found.我还输入了$ echo 'export PATH=/usr/local/git/bin:$PATH' >> ~/.profile以添加到路径,但它仍然返回找不到命令。

What would be the reasons for this?造成这种情况的原因是什么?

Are you prefixing correctly the git command?您是否正确地为git命令添加了前缀? Like this:像这样:

git init
git add

init and add are both subcommands of git . initadd都是git子命令 This means that you must do something like这意味着你必须做类似的事情

$ git init

or

$ git add

What would be the reasons for this?造成这种情况的原因是什么? no reason, i also understood as you check this out just go to desktop, create a new textfile, name it File1, and cut it to paste it at the repository Folder you created by the command $ git init Project1 you should find a Folder named Project1 at your desktop!没有理由,我也明白当你检查这个时,只需转到桌面,创建一个新的文本文件,将其命名为 File1,然后将其剪切粘贴到您通过命令 $ git init Project1 创建的存储库文件夹中,您应该找到一个名为的文件夹Project1 在您的桌面上! haha!哈哈! or at least at c:users/administrator/Project1 (or any username for the directory) paste it there and go back to the Git Bash to continue with $ cd Project1 $ git add File1.txt $ git commit.或者至少在 c:users/administrator/Project1(或目录的任何用户名)粘贴它并返回 Git Bash 继续 $ cd Project1 $ git add File1.txt $ git commit。 . . . . . . . . .etc etc etc hope i wasnt LATE! .etc 等等,希望我没有迟到!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM