【开发工具】【git】给修改过未提交的内容打patch包

修改代码,查看修改的代码

$ git status
On branch 20190506_xxx_driver
Your branch is up to date with 'origin/20190506_xxx_driver'.
Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git restore ..." to discard changes in working directory)
	modified:   arch/arm/configs/kedacom/h900_2g_defconfig
	modified:   drivers/char/peri-chip/h900_chip.c
	modified:   drivers/klsp/h900/bcsr.c
	modified:   drivers/klsp/h900/board_cfg.c
	modified:   drivers/klsp/h900/cpld_ctrl.c
	modified:   drivers/klsp/h900/cpld_ctrl.h
	modified:   drivers/klsp/h900/cpld_e1.c
	modified:   drivers/klsp/include/bcsr_common.h
	modified:   kernel/timeconst.pl
	modified:   pifm/Kconfig
	modified:   pifm/Makefile
	modified:   pifm/pifcfg/pif_tty.c
	modified:   pifm/pifdrv/Kconfig
	modified:   pifm/pifdrv/Makefile
	modified:   pifm/pifdrv/boards/h900/cn847x_setup.c
	modified:   pifm/pifdrv/boards/h900/e1phy_setup.c
	modified:   pifm/pifdrv/cn847x_mscc/cn847x.c

将修改的代码,生成patch包

git diff > h900.patch

在另一侧,合并patch包

$ git apply h900.patch
$ git status

On branch 20190506_xxx_driver
Your branch is up to date with 'origin/20190506_xxx_driver'.
Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git restore ..." to discard changes in working directory)
	modified:   arch/arm/configs/kedacom/h900_2g_defconfig
	modified:   drivers/char/peri-chip/h900_chip.c
	modified:   drivers/klsp/h900/bcsr.c
	modified:   drivers/klsp/h900/board_cfg.c
	modified:   drivers/klsp/h900/cpld_ctrl.c
	modified:   drivers/klsp/h900/cpld_ctrl.h
	modified:   drivers/klsp/h900/cpld_e1.c
	modified:   drivers/klsp/include/bcsr_common.h
	modified:   kernel/timeconst.pl
	modified:   pifm/Kconfig
	modified:   pifm/Makefile
	modified:   pifm/pifcfg/pif_tty.c
	modified:   pifm/pifdrv/Kconfig
	modified:   pifm/pifdrv/Makefile
	modified:   pifm/pifdrv/boards/h900/cn847x_setup.c
	modified:   pifm/pifdrv/boards/h900/e1phy_setup.c
	modified:   pifm/pifdrv/cn847x_mscc/cn847x.c

 

你可能感兴趣的:(Linux,日常使用与开发,git,开发工具,嵌入式)