Re: the simplest way to add a file to my git repo and submit as a patch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 5 Jul 2007, Eric Lesh wrote:

> You definitely don't need to create a new branch if you don't want to.
> (from master)
>     $ echo "foo" > newfile              # edit the file
>     $ git add newfile                   # add it to the index
>     $ git commit -m "Add newfile"       # commit it
>     $ git format-patch HEAD^            # get the diff versus the state before
>     $ git reset --hard HEAD^            # reset to state before
>
> HEAD^ means "the commit before the one I'm at right now."

actually, a little experimentation suggests that this might be all i
need:

  - physically add <new file>
  $ git add <new file>
  $ git diff HEAD > patchfile
  - physically remove <new file>
  $ git rm <new file>

what i get is a patch file that seems to fit the same pattern i'm used
to submitting.  does the above look sane?

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux