将文件的特定行提交到git [英] Commit specific lines of a file to git

查看:73
本文介绍了将文件的特定行提交到git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何在git

Possible Duplicate:
How can I commit only part of a file in git

如何提交从文件到git的一些特定行范围?而忽略同一文件中的其他一些行更改.

How do I commit a few specific line ranges from a file to git? while ignoring some other line changes in the same file.

推荐答案

尝试git add -p-它将以交互方式允许您添加,跳过或拆分diff块.

Try git add -p -- it will interactively let you add, skip, or split diff hunks.

这篇关于将文件的特定行提交到git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆