Ruby on rails 将我的存储库推送到Github时发生另一个错误

Ruby on rails 将我的存储库推送到Github时发生另一个错误,ruby-on-rails,git,github,terminal,Ruby On Rails,Git,Github,Terminal,当我进入终端时: Parkers-MacBook-Pro:first_app ppreyer$ git remote add origin git@github.com:ppreyer/first_app.git Parkers-MacBook-Pro:first_app ppreyer$ git push origin master 我得到以下错误: error: src refspec master does not match any. error: failed to push som

当我进入终端时:

Parkers-MacBook-Pro:first_app ppreyer$ git remote add origin git@github.com:ppreyer/first_app.git
Parkers-MacBook-Pro:first_app ppreyer$ git push origin master
我得到以下错误:

error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:ppreyer/first_app.git'
任何帮助都将不胜感激

因此,我返回并在终端中输入以下内容,并得到另一个错误:

Parkers-MacBook-Pro:first_app ppreyer$ git init
Reinitialized existing Git repository in /Users/ppreyer/.ssh/first_app/first_app/.git/
Parkers-MacBook-Pro:first_app ppreyer$ git add .
Parkers-MacBook-Pro:first_app ppreyer$ git commit -m
error: switch `m' requires a value
usage: git commit [options] [--] <filepattern>...

    -q, --quiet           suppress summary after successful commit
    -v, --verbose         show diff in commit message template

Commit message options
    -F, --file <file>     read message from file
    --author <author>     override author for commit
    --date <date>         override date for commit
    -m, --message <message>
                          commit message
    -c, --reedit-message <commit>
                          reuse and edit message from specified commit
    -C, --reuse-message <commit>
                          reuse message from specified commit
    --fixup <commit>      use autosquash formatted message to fixup specified commit
    --squash <commit>     use autosquash formatted message to squash specified commit
    --reset-author        the commit is authored by me now (used with -C-c/--amend)
    -s, --signoff         add Signed-off-by:
    -t, --template <file>
                          use specified template file
    -e, --edit            force edit of commit
    --cleanup <default>   how to strip spaces and #comments from message
    --status              include status in commit message template

Commit contents options
    -a, --all             commit all changed files
    -i, --include         add specified files to index for commit
    --interactive         interactively add files
    -o, --only            commit only specified files
    -n, --no-verify       bypass pre-commit hook
    --dry-run             show what would be committed
    --short               show status concisely
    --branch              show branch information
    --porcelain           machine-readable output
    -z, --null            terminate entries with NUL
    --amend               amend previous commit
    --no-post-rewrite     bypass post-rewrite hook
    -u, --untracked-files[=<mode>]
                          show untracked files, optional modes: all, normal, no. (Default: all)
Parkers MacBook Pro:first_app ppreyer$git init
在/Users/ppryer/.ssh/first\u app/first\u app/.Git中重新初始化现有Git存储库/
Parkers MacBook Pro:第一款应用程序ppryer$git add。
Parkers MacBook Pro:first_app ppreyer$git commit-m
错误:开关'm'需要一个值
用法:git提交[options][--]。。。
-q、 --成功提交后安静地抑制摘要
-v、 --提交消息模板中的详细显示差异
提交消息选项
-F、 --文件从文件中读取消息
--提交人覆盖提交人
--提交的日期覆盖日期
-m、 --讯息
提交消息
-c、 --重新编辑消息
重用和编辑来自指定提交的消息
-C、 --重用消息
重用来自指定提交的消息
--修复使用autosquash格式的消息修复指定的提交
--挤压使用autosquash格式的消息挤压指定的提交
--重置作者提交现在由我编写(与-C-C/--amend一起使用)
-s、 --签字人添加签字人:
-t、 --模板
使用指定的模板文件
-e、 --编辑强制编辑提交
--清理如何从消息中删除空格和#注释
--状态包括提交消息模板中的状态
提交内容选项
-a、 --所有提交所有更改的文件
-i、 --包括将指定文件添加到索引以提交
--交互式添加文件
-o、 --仅提交指定的文件
-n、 --无验证绕过预提交挂钩
--试运行展示将要承诺的内容
--简短地显示状态
--分行显示分行信息
--机器可读输出
-z、 --null使用NUL终止条目
--修正以前的承诺
--无后重写绕过后重写挂钩
-u、 --未跟踪的文件[=]
显示未跟踪的文件,可选模式:全部、正常、否(默认:全部)

错误是什么:开关'm'需要一个值意味着什么?

看起来您的遥控器没有主分支(您可能刚刚创建了它,它是空的?)

使用以下选项之一创建主分支:

git push -u origin master


该错误意味着您忘记在“提交”命令之后添加提交消息

正确用法是:

$ git commit -m "Initial Commit"

存储库是否存在?您当前的分支是否称为master?您是否确实向本地存储库提交了任何内容?没有初始提交,就没有
主分支。
$ git commit -m "Initial Commit"