As my question says, after changing files and adding new files in my repository, I normally commit files with git, but sometimes I need all the modified / changed files copied to a folder for organizing-myself reasons.
Any option?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you mean you haven’t yet committed, and want to package up all of the files that currently have local modifications (but not completely new files), you can get the list of modified files with
git ls-files --modified. If you want the files which were changed by the last commit, you could usegit diff --name-only HEAD^. Where you go from there is up to you. Examples:Note that this is using the versions of files in the working tree currently.
If you have spaces in filenames, you’ll have to go to a little more trouble.
(Of course, depending on what you’re really trying to do, you might be looking for
git stash, which stashes away all modified files and leaves you with a clean working tree, or you could simply want to make a temporary branch to commit to.)