Sourcetree and .gitignore: I don't find an explicitly ignored file name - filenames

I wanted to ignore a certain file for only its project's repository, and by accident I selected to add the ignore entry to the global ignore list.
My Sourcetree preferences says my .gitignore_global file is at path /Users/myuser/.gitignore_global. I go there and indeed I see the modification date of that file matches the time I selected to add the ignore entry, but when I open it, I don't see any explicit file name there.
So, how could I revert the change I made?

Go the the folder where that file is ignore and type:
git check-ignore -v -- aFile
That will give you the exact location of the ignore file which is responsible for not tracking (ignoring) said file.

Related

is there a way to use the full file path in the command line without typing it?

For example, I want to open a PDF file in the browser from the command line (just because it's much faster and I need to open many files at once) and when I use the command start [file name] from its directory it try to open it as a executable, so I need to open the browser and type the full path of the file as an attribute, is there a way to call the full path without typing it?
what I exactly need is I need the full path of a file to convert it to string (for example in the browser)
Using tab completions may help. For example, if your target file is named thisPDFisTotallyBananas.pdf and you have another file in the same folder named thisOtherPDFisNot.pdf, you could type thisP then TAB to complete the file name in the command prompt without needing to type the whole filename.

Configure Less with PhpStorm doesn't compile

I am trying to compile my styles.less to styles.css. My folder structure is following:
assets->less->styles.less
assets->css->styles.css
I believe my configurations are wrong. In PhpStorm I set less output path to refresh: ../css/$FileNameWithoutExtension$.css
I do have a styles.css file under the less file and it is compiling.
So far I only know regular CSS so I'm not very familiar with Less yet.
Any help?
Your File Watcher setup is incomplete.
Right now it will save the generated file next to the source... but you need it 2 folders up.
You did set up correctly in Output paths to refresh .. but that file tells IDE what file to check when file watcher is finished running. It is not where the generated file will be placed.
You need to alter your Arguments field.
Currently you have ... $FileName$ $FileNameWithoutExtension$.css ...
You need to adjust the path there -- it has to be ... $FileName$ ../../css/$FileNameWithoutExtension$.css ... -- because that's where you specify such path.
(leading and trailing "..." means other parameters that you have got there)
You should have changed the Arguments field accordingly;
Like:
Arguments: --no-color $FileName$ $ProjectFileDir$/themes/elisa/assets/css/$FileDirPathFromParent(less)$$FileNameWithoutExtension$.css
Output paths to refresh: $ProjectFileDir$/themes/elisa/assets/css/$FileDirPathFromParent(less)$$FileNameWithoutExtension$.css

Why .RAR file contains different files with the same name

I got a .RAR file which contains different files with the same name.
For example,
index.txt 40 Text Document 04/01/2010 4:40PM
index.txt 22 Text Document 04/01/2010 4:42PM
index.txt 10 Text Document 04/01/2010 4:45PM
index.txt 13 Text Document 04/01/2010 4:50PM
Why?
Like said before, the files could be in separate paths, but as I'll show further, this isn't always the case.
If you use WinRAR to list the file contents and your options are set as the following, then it only appears you have files with the same name, but they are in different paths.
Options -> File list -> Flat folders view (ctrl+h)
Options -> File list -> Details
After the column CRC32, there is one called Path. If this is different, extraction shouldn't be a problem if:
Extract -> Extraction path and options -> Advanced -> Extract relative paths is set.
If it is Do not extract paths, WinRAR will need to ask you to rename them because of file system limitations.
I assume command line unrar won't be a problem in this case because you need to specify additional parameters to change its default behavior.
It is possible for a RAR archive to have multiple files with the same name in the same directory. If you use Windows, use "C:\Program Files\WinRAR\Rar.exe"
instead of rar on the command line in the following examples.
Create a new file and add it to a RAR archive. You can also check the changes by listing its contents.
rar a rarfile.rar testfile.txt
rar l rarfile.rar
rar a rarfile.rar testfile.txt
If you try to re-add this file, rar will replace the already added file with the same name.
Updating archive rarfile.rar
Updating testfile.txt OK
Done
Create an other file or rename the first one and add it to the RAR file.
move testfile.txt second.txt (new file)
rar a rarfile.rar second.txt (add it)
rar lb rarfile.rar (list archive, bare info)
Rename the second file to the first one's name.
rar rn rarfile.rar second.txt testfile.txt
This is how you create a RAR file with multiple files of the same name in the same path. These steps will be similar in WinRAR. If you try to rename the file again, the file name of all files in that directory will change too.
Why would someone want to do this?
The only explanation I can think of is that the person that created this archive wanted to imitate a version control/backup system. But if you want to extract only one specific version and it isn't the first one, WinRAR extracts the wrong file. It seems I've found a very obscure WinRAR bug :-)
Edit: seems a bad explanation after finding this in the RAR documentation:
-ver[n] File version control
Forces RAR to keep previous file versions when updating
files in the already existing archive. Old versions are
renamed to 'filename;n', where 'n' is the version number.
By default, when unpacking an archive without the switch
-ver, RAR extracts only the last added file version, the name
of which does not include a numeric suffix. But if you specify
a file name exactly, including a version, it will be also
unpacked. For example, 'rar x arcname' will unpack only
last versions, when 'rar x arcname file.txt;5' will unpack
'file.txt;5', if it is present in the archive.
If you specify -ver switch without a parameter when unpacking,
RAR will extract all versions of all files that match
the entered file mask. In this case a version number is
not removed from unpacked file names. You may also extract
a concrete file version specifying its number as -ver parameter.
It will tell RAR to unpack only this version and remove
a version number from file names. For example,
'rar x -ver5 arcname' will unpack only 5th file versions.
If you specify 'n' parameter when archiving, it will limit
the maximum number of file versions stored in the archive.
Old file versions exceeding this threshold will be removed.
they are in different paths, most likely.
try outputting the full path. or see what happens when you extract them.
you'll probably see something like:
index.txt
path1/index.txt
path2/index.txt
etc etc

cmake move directory

I was wondering if there was a way (such as a commad) to move a directory filled with, say, image files, to the build directory using cmake 2.8.
Thanks in advance!
The file() command can do what you want.
From the cmake manual:
The file() command also provides COPY and INSTALL signatures:
file(<COPY|INSTALL> files... DESTINATION <dir>
[FILE_PERMISSIONS permissions...]
[DIRECTORY_PERMISSIONS permissions...]
[NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS]
[FILES_MATCHING]
[[PATTERN <pattern> | REGEX <regex>]
[EXCLUDE] [PERMISSIONS permissions...]] [...])
The COPY signature copies files, directories, and symlinks to a destination fold Relative input paths are evaluated with respect to the current source directory, and a relative destination is evaluated with respect to the current build directory. Copying preserves input file timestamps, and optimizes out a file if it exists at the destination with the same timestamp. Copying preserves input permissions unless explicit permissions or NO_SOURCE_PERMISSIONS are given (default is USE_SOURCE_PERMISSIONS). See the install(DIRECTORY) command for documentation of permissions, PATTERN, REGEX, and EXCLUDE options.
So you would have something like (tested):
file(COPY ${YOUR_SRC_IMAGE_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/YourPreferedDestination)
To move, you can use the RENAME form:
file(RENAME ${YOUR_SRC_IMAGE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/PreferedDestination)
But I am not sure that you would want that, because the source will not be available anymore to reproduce the build sequence, hence my attempt to answer with the copy command above.

How to find any "txt" file at particular location in system?

I have a robot to find a file of the given name at a particular location in a system but now I want to find all the text files at that particular location. I have tried to use "*.txt", but it didn't worked out. Is there a way to do that?
file.exists ♥environment⟦USERPROFILE⟧\Documents\t.txt errormessage ‴Sorry, I could not find a file‴
dialog ‴File exists‴
You can use the directory command. The pattern arguments allows you to filter out files of a particular extension.
directory path ♥environment⟦USERPROFILE⟧\Desktop pattern *.txt result ♥files
dialog ♥files⟦count⟧
The above code should let you know how many files of the given extension exist in the given directory.
You could take values from the returned list and use it with file.exists command.