Igor
Igor

Reputation: 6255

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

I forked the main wxWidgets repo in wxFork directory. But I didn't commit from that directory.

So where is my commit and how do I push my changes to my fork?

Thank you.

[EDIT]

The results are:

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)

[/EDIT]

Upvotes: 2

Views: 3806

Answers (1)

Vlad
Vlad

Reputation: 9481

Assuming you want to commit file widgets.cpp

You did not create any commit... here is what you need to do:

      git add samples/widgets/widgets.cpp

then

      git commit

and then

      git push

If you want to commit all modified files, you can combine first two commands into one like this

     git  commit -a

Upvotes: 1

Related Questions