我的承诺在哪里以及为什么我无法推动?

时间:2016-05-14 03:20:10

标签: git github git-commit git-push

:=

我在wxFork目录中分叉了主要的wxWidgets repo。但我没有从该目录中提交。

那么我的提交在哪里?如何将我的更改推送到我的分支?

谢谢。

[编辑]

结果是:

Igors-MacBook-Air:text igorkorot$ git status
On branch text_indent
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   ../../../samples/text/text.cpp
    modified:   ../../../samples/widgets/widgets.cpp
    modified:   ../../../src/osx/cocoa/textctrl.mm

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    ../../../9302.patch
    ../../

no changes added to commit (use "git add" and/or "git commit -a")
Igors-MacBook-Air:text igorkorot$ git add ../../../samples/text/text.cpp ../../../src/osx/cocoa/textctrl.mm 
Igors-MacBook-Air:text igorkorot$ git commit
[text_indent 39d71df] Left indent on Cocoa
2 files changed, 33 insertions(+), 8 deletions(-)
Igors-MacBook-Air:text igorkorot$ git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Everything up-to-date
Igors-MacBook-Air:text igorkorot$ git status
On branch text_indent
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   ../../../samples/widgets/widgets.cpp

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    ../../../9302.patch
    ../../

no changes added to commit (use "git add" and/or "git commit -a")
Igors-MacBook-Air:text igorkorot$ pwd
/Users/igorkorot/wxFork/buildMac/samples/text
Igors-MacBook-Air:text igorkorot$ cd ../../..
Igors-MacBook-Air:wxFork igorkorot$ git status
On branch text_indent
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   samples/widgets/widgets.cpp

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    9302.patch
    buildMac/

no changes added to commit (use "git add" and/or "git commit -a")

[/编辑]

1 个答案:

答案 0 :(得分:1)

假设您要提交文件widgets.cpp

你没有创建任何提交......这是你需要做的事情:

      git add samples/widgets/widgets.cpp

然后

      git commit

然后

      git push

如果要提交所有已修改的文件,可以将前两个命令合并为一个,如此

     git  commit -a