Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy only addition changes in split mode github/git

Tags:

git

github

Further to my old question, I have merged the changes. But still there are some customisations in an another commit. From that commit I have to get some of the changes from some specific files(not all changes of a file).

Since I went to github commit in split mode & tried to copy the content. but it seems it copies both additions and deletions for that file eg.these changes.

  • Is there any tool that will allow me to copy only additions part from selected lines?

  • Any command line tool also be ok.

like image 805
trex Avatar asked Mar 24 '15 05:03

trex


People also ask

Does git diff show all changes?

The git diff command returns a list of all the changes in all the files between our last commit and our current repository. If you want to retrieve the changes made to a specific file in a repository, you can specify that file as a third parameter.

What command is used to stage only some changes in a file?

git add -p is basically "git add partial (or patch)" Patch mode allows you to stage parts of a changed file, instead of the entire file.


1 Answers

git add -p

can be used to commit some changes(not all) with in a file.

like image 108
xCord Avatar answered Oct 08 '22 02:10

xCord