Skip to content

mathiasdahl/git-cat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-cat

Use Emacs to find and view files in a bare git repository

Why?

I have a number of bare git repositories to which I sync files from and to different computers. Now and then I need to find a file when I'm inside a bare repository. `git-cat' helps with that.

To use it, make sure you are in a bare git repository or inside a .git directory, then type M-x git-cat RET, enter a file name pattern (a regexp), and type RET. Then select the file to view among the hits.

The files will be saved in your temporary directory named with the full path of the file in the repository. Each slash is replaced by an underscore. If you want to view the same file again, you will be asked if you want to overwrite the file in the temporary directory.

Surely Magit can do this, right?

Perhaps I didn't try hard enough, but I could get Magit to list files in a bare repo.

See it in action

Below I'm in the .git folder of this repository:

git folder

Activating git-cat and I decide to list all files that has a period in the file name (the input is sent to grep via a shell command and the period needs to be escaped twice):

select file

I now get a filtered list of all files in the repository and need to select one of the files:

select file

Since I opened this file before, I'm asked to overwrite it:

git-cat ask to overwrite

Finally, the file is shown:

file shown

git-cat works very well with ivy and, I suspect with most completion frameworks.

About

Use Emacs to find and view files in a bare git repository

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published