GitHub for Windows: how to commit only part of a file?

I am new to GitHub for Windows. I will learn how to make one change. But I do not understand how I can transfer only part of the file. On GitHub for Mac, you can simply select the line.

How can I do this on github for windows?

+8
git-commit github-for-windows
source share
1 answer

Update: January 2015, 14th: Partial commit on GitHub for Windows :

The new version of GitHub for Windows supports the selection of lines or blocks of changes when creating a commit. Just press the desired lines in the gutter, create a commit and leave the rest of the changes to continue.

https://cloud.githubusercontent.com/assets/359239/5745722/ab3d336e-9bdf-11e4-8001-fc7316e8155b.gif

The GitHub post adds what I mentioned in my original answer below:

For people familiar with the command line, this change is like an interactive stage using git add -i or git add -p .


(Original answer: August 2013)

From GitHub for Windows, you can open a console and type:

 git add -p -- path/to/your/File 

Then you can do exactly what you want from this file.

git add --patch :

Interactively select patch pieces between the index and the work tree and add them to the index.
This allows the user to see the difference before adding the changed content to the index.

+9
source share

All Articles