2012-06-06 63 views
0

當我進入終端:另一個錯誤推我的倉庫到Github上

Parkers-MacBook-Pro:first_app ppreyer$ git remote add origin [email protected]: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 '[email protected]: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) 

是什麼錯誤:開關'M」需要一個值是什麼意思?

+0

是否庫中存在呢? –

+1

你目前的分支叫做主人嗎? –

+1

您是否確實向本地存儲庫提交了任何內容?沒有初始提交,就沒有'master'分支。 – larsks

回答

0

它看起來像你的遙控器不具有主分支(你可能只是創造了它,它是空的?)的

使用下列操作之一創建主分支:

git push -u origin master 

git push origin master:master 
0

的錯誤意味着你忘了「提交」命令後添加一個提交信息。

正確的用法是:

$ git commit -m "Initial Commit" 
相關問題