Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to verify that git exile works?

Tags:

git

I try to use git exile. This is the sequence of actions that I usually take:

  1. Copy huge files to the repository (by that I replace the "old" content of the files by "new" content).
  2. git add (I guess that we do not copy the binary files to the "staging area" / "index" because the repository is "exile". Instead of that the "staging area" will get only a link to the "huge" content.)
  3. git exile push (I do not know what it does.)
  4. git commit

My expectation was that after this action, content of "huge" files will be copied to the drive and the original content of these files (in the local repository) will be replaced by a link to their location on the drive. However, for some reason I cannot verify it explicitly. I still have huge binary files in my repository (at least it is what I see with ls or du commands, or when I open the files with less).

Maybe my interpretation is wrong. Maybe the "links" exist only in the "staging area" and not in the "work-tree" / "file system".

What I basically want, is a switch between two states: (1) some files contain the original huge content, (2) file contain links to the huge content which is copied to the drive.

In other words, when I clone (or pull) the repository, I see "links" in some of the files (instead of the actual binary content). Then I replace these links by huge "binary content". Do the above described sequence of commands ("git add" + "git exile push" + "git commit") and, as a result, I still have the huge binaries in my working-tree. But now I want to push the local repository to the remote one and I do not want to push binary, I want to push new links. I pulled links and I want to push links. How can I achieve it?

like image 505
Roman Avatar asked Apr 10 '18 15:04

Roman


People also ask

How do I check my git status?

To check the status, open the git bash, and run the status command on your desired directory. It will run as follows: $ git status.

What command shows what being worked on local git?

You can see the list of all the commits you made (along with their commit messages) with git log . If you do git log -p , it will show you the full commit history, including the changes each commit made.


1 Answers

Link 1 : The documentation on the git-exile github might be interesting:

https://github.com/patstam/git-exile

Link 2 : Check out this post for the mechanism:

What is the difference between "git push" and "git exile push"?

To maybe clear up some of the questions you had:

The replacement actually happens at git add time (See link 2)

When you use git exile push:

When you add files to git, git-exile stores the real content in the .git/exile folder and uses the data there to silently replace references with the real file contents when needed.

when you push:

This will look for exiled files in the current directory and all subdirectories, and push the objects corresponding to the current version to the remote repository.

You seemed to have more than one question, maybe with reference to the overall logic/understanding of git exile. I would suggest to look at those 2 links for the mechanism :) However, I hope this helps a little!

like image 101
Achooo Avatar answered Sep 21 '22 00:09

Achooo