![]() If clean.requireForce is set to "true" (the default) in your configuration, one needs to specify -f otherwise nothing will actually happen.Īgain see the git-clean docs for more information. Note the case difference on the X for the two latter commands. To remove ignored and non-ignored files, run git clean -f -x or git clean -fx.To remove ignored files, run git clean -f -X or git clean -fX.To remove directories, run git clean -f -d or git clean -fd.Step 1 is to show what will be deleted by using the -n option: # Print out the list of files and directories which will be removed (dry run)Ĭlean Step - beware: this will delete files: # Delete the files from the repository arguments are given, only those paths are affected. This can, for example, be useful to remove all build products. Normally, only files unknown to Git are removed, but if the -x option is specified, ignored files are also removed. Git-clean - Remove untracked files from the working tree Synopsis git clean …Ĭleans the working tree by recursively removing files that are not under version control, starting from the current directory. ![]() … but it's more important to me to get to the status of all tracked files, as in the pseudo git status-tracked above.Īny command in git, that already does something like this? Ultimately, I'd like to also show the status of all files in a directory, as in the pseudocode: git status-tracked-and-untracked ![]() would a symbol indicating a tracked, but unchanged file (if I recall correctly, SVN may use a U character for these). For instance, I'd like to obtain something like the pseudocode: git status-tracked What I'm looking for, is a command which will show all tracked files in a directory (which git ls-files -v does), with their accurate repository status (which git ls-files doesn't show, as it shows H as status for all tracked files). # Untracked files not listed (use -u option to show untracked files) # no changes added to commit (use "git add" and/or "git commit -a") " to discard changes in working directory) Below is a snippet which demonstrates that, and the diverse outputs of git status vs git ls-files ( git shell output is prefixed with #): echo "test more" > file_tracked_changed.txt Now, after the initial commit, I want to change the file_tracked_changed.txt files, and keep the others (here, only file_tracked_unchanged.txt) unchanged for the next commit. Git config user.email "test" > file_tracked_unchanged.txt Here is a brief snippet example (which you can paste in your Linux terminal), creating a new git repository and adding some files to it (using git version 1.7.9.5): cd /tmp/
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |