Information Technology Reference
In-Depth Information
$ git show [REVISION]:[FILENAME] > [new-filename]
This is the way to check out the files with names that are not allowed in your sys-
tem, for example. If you create a file named some*strange*name.txt in Linux,
then it won't be able to check out the file in Windows. Working on Windows, you can
still checkout this file using a new name for it:
$ git show HEAD:some*strange*name.txt >
some-strange-name.txt
The most astonishing example of problems with filenames I encountered was when
I was training someone who was working on Linux and who used filenames with trail-
ing dots, as in:
$ echo lorem > lorem.
The environment was heterogeneous—trainees were using Windows and Linux. The
trainees using Windows couldn't get a clean checkout of the repository anymore. Right
after the clone command the repository was dirty. If the revisions such as this are
already public, the remedy is to check out the files and change their names. Thanks to
$ git show [REVISION]:[FILENAME] > [new-filename] , this can be
done on any platform.
5-13. Switching branches in a bare repos-
itory
Problem
You have cloned a bare repository and its current branch is master . You want to
switch to a different branch.
Solution
Clone the repository created in Recipe 05-01 using the following commands:
Search WWH ::




Custom Search