繁体   English   中英

我的提交在哪里,为什么我不能推送?

[英]Where is my commit and why I can't push?

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")

我在 wxFork 目录中分叉了主要的 wxWidgets 存储库。 但我没有从那个目录提交。

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

谢谢你。

[编辑]

结果是:

Igors-MacBook-Air:wxFork igorkorot$ git remote show origin
* remote origin
  Fetch URL: https://github.com/oneeyeman1/wxwidgets.git
  Push  URL: https://github.com/oneeyeman1/wxwidgets.git
  HEAD branch: master
  Remote branches:
    AUTOCONF_ARCHIVE        tracked
    BAKEFILE                tracked
    BAKEFILE_BRANCH         tracked
    CPPUNIT                 tracked
    EXPAT                   tracked
    GSTREAMER               tracked
    GTK1                    tracked
    GTK2                    tracked
    LIBPNG                  tracked
    NEW_TBAR                tracked
    PKG_CONFIG              tracked
    RXSPENCER               tracked
    SDL                     tracked
    SOC2006_RTL             tracked
    SOC2006_SOCKETS         tracked
    SOC2007_DVC             tracked
    SOC2007_WXWEB           tracked
    SOC2007_XTI             tracked
    SOC2008_WXWALLCTRL      tracked
    SOC2009_AUI             tracked
    SOC2009_FSWATCHER       tracked
    SOC2009_RIBBON          tracked
    SOC2010_GUI_TEST        tracked
    SOC2010_MASKED_CTRL     tracked
    SOC2010_RTC_IMAGES      tracked
    SOC2010_WIN7_UI         tracked
    SOC2011_ANIMATION       tracked
    SOC2011_GTK3            tracked
    SOC2011_WEBVIEW         tracked
    SOC2011_WXIOS           tracked
    SOC2014_QT              tracked
    SOC2014_TASKBAR         tracked
    WXSTANDALONE_EXPERIMENT tracked
    WX_2_0_FIXES            tracked
    WX_2_10_BRANCH          tracked
    WX_2_2_BRANCH           tracked
    WX_2_4_BRANCH           tracked
    WX_2_6_BRANCH           tracked
    WX_2_8_BRANCH           tracked
    WX_2_8_MICROFIX_BRANCH  tracked
    WX_2_9_0_BRANCH         tracked
    WX_3_0_BRANCH           tracked
    ZLIB                    tracked
    arbitrary_weights       tracked
    karsten                 tracked
    master                  tracked
    ownerdraw-refactor      tracked
    show_hidden             tracked
    wxPy-3.0-branch         tracked
    wxPy-3.0.0              tracked
    wxPy_branch             tracked
    wxPy_newswig            tracked
    wxPy_temp_253_branch    tracked
    wxQT                    tracked
    wxSYMBIAN               tracked
    wxUNIVERSAL             tracked
    wxWebKitBranch-2.8      tracked
  Local branches configured for 'git pull':
    arbitrary_weights merges with remote arbitrary_weights
    master            merges with remote master
    show_hidden       merges with remote show_hidden
  Local refs configured for 'git push':
    arbitrary_weights pushes to arbitrary_weights (up to date)
    master            pushes to master            (up to date)
    show_hidden       pushes to show_hidden       (up to date)

Igors-MacBook-Air:wxFork igorkorot$ git remote -v
origin  https://github.com/oneeyeman1/wxwidgets.git (fetch)
origin  https://github.com/oneeyeman1/wxwidgets.git (push)

[/编辑]

假设您要提交文件 widgets.cpp

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

      git add samples/widgets/widgets.cpp

然后

      git commit

进而

      git push

如果你想提交所有修改过的文件,你可以像这样将前两个命令合并为一个

     git  commit -a

暂无
暂无

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

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