[ACCEPTED]-How to tell if git has ever tracked file X-git
Accepted answer
Simplest would be git log --all -- x/y/fubar
- if the file was there, it 1 would have give atleast one log entry.
A nicer approach would be:
git log --all --pretty=format: --name-only --diff-filter=A | sort - | grep fubar
Merged from a 1 couple of other answers.
Here is two useful alias: FindFile ff
and 3 FindFilewithCopies ffc
:
# Find if one file ever had into repository
ff = "!git log --pretty=format: --name-status --all -M -B | sort -u | grep $1 #"
# The same as above but showing copied files
ffc = "!git log --pretty=format: --name-status --all -C -M -B | sort -u | grep $1 #"
You get information 2 about file names and operations with them.
Sample 1 use:
$ git ff create
A database/migrations/2014_10_12_000000_create_users_table.php
A database/migrations/2014_10_12_100000_create_password_resets_table.php
A database/migrations/2015_05_11_200932_create_boletin_table.php
A database/migrations/2015_05_15_133500_create_usuarios_table.php
D database/migrations/2015_05_12_000000_create_users_table.php
M database/migrations/2015_05_11_200932_create_boletin_table.php
R051 database/migrations/2014_10_12_000000_create_users_table.php database/migrations/2015_05_12_000000_create_users_table.php
$ git ffc create
A database/migrations/2014_10_12_000000_create_users_table.php
A database/migrations/2014_10_12_100000_create_password_resets_table.php
A database/migrations/2015_05_11_200932_create_boletin_table.php
A database/migrations/2015_05_15_133500_create_usuarios_table.php
C052 database/migrations/2014_10_12_000000_create_users_table.php database/migrations/2015_05_11_210246_create_boletin_nosend_table.php
D database/migrations/2015_05_12_000000_create_users_table.php
M database/migrations/2015_05_11_200932_create_boletin_table.php
R051 database/migrations/2014_10_12_000000_create_users_table.php database/migrations/2015_05_12_000000_create_users_table.php
(Posible duplicated from: List all the files that ever existed in a Git repository)
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.