Git-mediaGit-media is developed using the Ruby language, so you must first install the gem (LCTT: Gem is a Ruby-Based Development Kit ). Installation instructions are available on the website. Users who want to use git-meida need to install it. Because gem is a cross-platform tool, it is applicable to all platforms.
After installing git-media, you need to set some Git configuration options. You only need to configure it once on each machine.
$git config filter.media.clean "git-media filter-clean"$ git config filter.media.smudge "git-media filter-smudge"
In each repository where you want to use git-media, set an attribute to combine the created filter into the file type that you want to classify as "media. Do not be confused by such terms. A better term is "asset", because "media" usually refers to audio, video, and photos, but you can also easily convert 3D models, baking and textures are classified as media.
For example:
$ echo "*.mp4 filter=media -crlf" >> .gitattributes$ echo "*.mkv filter=media -crlf" >> .gitattributes$ echo "*.wav filter=media -crlf" >> .gitattributes$ echo "*.flac filter=media -crlf" >> .gitattributes$ echo "*.kra filter=media -crlf" >> .gitattributes
When you want to saveStageThese types of files are copied to the git/media directory.
Assume that a Git source warehouse already exists on the server. The last step is to tell the source warehouse where the "mother ship" is located, that is, when a media file is pushed to all users for sharing, the location where the media file will be stored. This is set in the git/config file of the Repository. Replace it with your username, host, and Path:
[Git-media] transport = scpautodownload = false # The default value is true. Pull the resource scpuser = sethscphost = example. comscppath =/opt/jupiter. git
If SSH settings on your server are complex, such as using a non-standard port or a path to a non-default SSH key file, use ssh/config to set the default configuration for the host.
The use of git-media is the same as that of a common file. You can treat a common file as a blob file and perform the same commit operation. The only difference in the operation process is that, in some cases, you should synchronize your assets (or media) to the shared repository.
To release assets or back up data for a team, run the following command:
$ git media sync
When you replace a file in git-media with a new version (for example, an audio file that has already been voiced, or a completed mask painting, or a video file that has been color-rated), you must explicitly tell Git to update the media. This will overwrite the default settings where git-media does not copy a remote existing file:
$ git update-index --really-refresh
When another member of your team (or you, on another machine) clones the repository, if the autodownload option is not set to true in git/config, resources are not downloaded by default. However, git media sync, a synchronization command of git-media, solves all problems.
Git-annexThe git-annex processing process is slightly different. The local repository is used by default, but the basic idea is the same. You can install git-annex from the software repository of your release, or download and install it from the website as needed. Like git-media, any user who uses git-annex must install it on the machine.
Its initialization settings are easier than git-media. Run the following command to replace it with your path to create a bare repository on your server:
$ git init --bare --shared /opt/jupiter.git
Clone it to the local computer and mark it as the initial path of git-annex:
$ git clone seth@example.com:/opt/jupiter.cloneCloning into 'jupiter.clone'... warning: You appear to have clonedan empty repository. Checking connectivity... done.$ git annex init "seth workstation" init seth workstation ok
Do not use filters to differentiate media resources or large files. You can use the git annex command to configure large files for classification:
$ git annex add bigblobfile.flacadd bigblobfile.flac(checksum) ok(Recording state in Git...)
Submit a file like a normal file:
$ git commit -m 'added flac source for sound fx'
However, the push operation is different because git annex uses its own branch to track assets. The-u option may be required for your first push, depending on how you manage your Repository:
$ git push -u origin master git-annexTo seth@example.com:/opt/jupiter.git* [new branch] master -> master* [new branch] git-annex -> git-annex
Like git-media, common git push commands do not copy data to the server, but only send related messages. To truly share files, run the synchronization command:
$ git annex sync --content
People have submitted shared resources. You need to pull them. The git annex sync command will prompt you to locally check resources that do not exist on your local machine but exist on the server.
Git-media and git-annex are both flexible and can both use local repositories instead of servers. Therefore, they are often used to manage private local projects.
Git is a very powerful and scalable system application software, and we should not hesitate to use it. Try it now!
From: http://www.php230.com/1480419001.html
Address: http://www.linuxprobe.com/large-objects.html