Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding certain files (images) to git without versioning

Tags:

git

I am having a dilemma right now regarding storing images:

  • right now my project has just started.
  • During the first few development iterations, I am seeing that there will be lots of change request on the gui of my project especially the images and icons.

I would like to check them in only if it comes to a point that the requests are very minimal. with this, I don't like my git repository to be cluttered with images since I have images that are in megabytes in size.

Currently, what I am doing is include almost everything except binaries, object files and images to my git repo.
Then every week, I do a full zip backup of everything.

What I would like to ask is, if there is a way to put files in git without versioning?

I know it defeats the purpose of git but the size of the git repo can be controlled with this way.

To illustrate:

  • I have pic1.jpg. I would like to put it into git.
  • if I will replace pic1.jpg with another image but with the same filename, it will just overwrite the pic1.jpg and don't do version backups.
    This way the git repo will dramatically increase in size.

This may sound dangerous, but from what I have learned from git is that if you committed a file into it, it will stay there forever.

There is another solution I think of: The project will be fully zipped and placed inside a dropbox and the developer who is new to the project will get it from the dropbox, extract, do a git fetch, then merge.

I hope someone could share their experience/expertise regarding this.

like image 398
newbie programmerz Avatar asked May 03 '14 01:05

newbie programmerz


People also ask

How do I manually add a file to Git?

On GitHub.com, navigate to the main page of the repository. Above the list of files, using the Add file drop-down, click Upload files. Drag and drop the file or folder you'd like to upload to your repository onto the file tree.

How do I restrict a file in Git?

You can't. If you give someone the push permission, he will be able to push whatever he want. If you want someone to have a partial access, you have many choices: Make him fork and pull-request the repository.

Should you use Git LFS for images?

Should I Use Git LFS? You should use Git LFS if you have large files or binary files to store in Git repositories. That's because Git is decentralized. So, every developer has the full change history on their computer.

Can Git handle images?

Rendering and diffing imagesGitHub can display several common image formats, including PNG, JPG, GIF, PSD, and SVG. In addition to simply displaying them, there are several ways to compare differences between versions of those image formats.


1 Answers

if there is a way to put files in git without versioning

The only one proposing that is git-annex (not available on Windows)

I mention in "Git repository setup with binaries" another tool "bup", which actually store the data in a git-compatible repo.

But if you don't intent to go back often and rebuilt old version of your project, putting those resources (large pictures) in a git repo isn't very useful, and git-annex can help dealing with that state.

Beware of git repo through dropbox, it isn't always safe (see "Git with Dropbox Issues").

like image 77
VonC Avatar answered Sep 18 '22 18:09

VonC