problem patching a file in local git repo and then pushing it to github

142 views
Skip to first unread message

Sayantan Datta

unread,
Oct 20, 2012, 11:05:47 AM10/20/12
to nitd...@googlegroups.com
i received a patch file.
I did the following commands with it.

[sayantan@kenzo450D NoiseEstimate]$ git apply --stat nrestimate_cleanup.patch
NoiseEstimate.pro | 5 -
main.cpp | 26 +++
mainwindow.cpp | 331 ++++++++----------------------------------
mainwindow.h | 40 ++++-
nrestimate.cpp | 415 +++++++++++++++++++++++++++++++++++++++++++++++++++++
nrestimate.h | 62 ++++++++
[sayantan@kenzo450D NoiseEstimate]$ git apply --check nrestimate_cleanup.patch
[sayantan@kenzo450D NoiseEstimate]$ git am --signoff < nrestimate_cleanup.patch
previous rebase directory
/home/sayantan/WORK/samples/NoiseEstimate/.git/rebase-apply still
exists but mbox given.


[sayantan@kenzo450D NoiseEstimate]$ patch -p1 < nrestimate_cleanup.patch
patching file NoiseEstimate.pro
patching file main.cpp
patching file mainwindow.cpp
patching file mainwindow.h
patching file nrestimate.cpp
patching file nrestimate.h

[sayantan@kenzo450D NoiseEstimate]$ git push
Everything up-to-date


how to install the patch?

Jasneet Bhatti

unread,
Oct 21, 2012, 5:03:54 AM10/21/12
to nitd...@googlegroups.com
Did you commit the changes before trying to push ? I'm not sure if git forbids you from pushing when you have uncommitted changes, in which case, this question can be ignored ;)

[sayantan@kenzo450D NoiseEstimate]$ git push
Everything up-to-date


how to install the patch?

--
You received this message because you are subscribed to the Google Groups "GNU/Linux Users' Group, NIT Durgapur" group.
To post to this group, send email to nitd...@googlegroups.com.
To unsubscribe from this group, send email to nitdgplug+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nitdgplug?hl=en.


Samikshan Bairagya

unread,
Oct 21, 2012, 8:25:13 AM10/21/12
to nitd...@googlegroups.com
On Sat, Oct 20, 2012 at 8:35 PM, Sayantan Datta <kenzo....@gmail.com> wrote:
What does git status show you? I think you need to first
commit your changes before pushing.

Cheers
--
Samikshan Bairagya
KDE Developer, India
http://samxan.wordpress.com | http://about.me/samikshan

Sayantan Datta

unread,
Oct 21, 2012, 4:14:43 PM10/21/12
to nitd...@googlegroups.com
SOLVED

I installed the patch using patch command, and then made the git add,
git commit and then git push. Worked perfectly. :)

Thanks everyone.
Reply all
Reply to author
Forward
0 new messages