git-annex/doc/walkthrough/modifying_annexed_files.mdwn
Joey Hess 20741b1eb4
Automatically convert direct mode repositories to v7 with adjusted unlocked branches
* Automatically convert direct mode repositories to v7 with adjusted
  unlocked branches and set annex.thin.
* init: When run on a crippled filesystem with --version=5,
  will error out, since version 7 is needed for adjusted unlocked branch.
* direct: This command always errors out as direct mode is no longer
  supported.
* indirect: This command has become a deprecated noop.
* proxy: This command is deprecated because it was only needed in direct
  mode. (But it continues to work.)

Also removed mentions of direct mode throughough the documentation.

I have not removed all the direct mode code yet.
2019-08-26 15:05:25 -04:00

31 lines
1.2 KiB
Markdown

Normally, the content of files in the annex is prevented from being modified.
That's a good thing, because it might be the only copy, you wouldn't
want to lose it in a fumblefingered mistake.
$ echo oops > my_cool_big_file
bash: my_cool_big_file: Permission denied
In order to modify a file, it should first be unlocked.
$ git annex unlock my_cool_big_file
unlock my_cool_big_file (copying...) ok
That replaces the symlink that normally points at its content with a copy
of the content. You can then modify the file like any regular file. Because
it is a regular file.
(If you decide you don't need to modify the file after all, or want to discard
modifications, just use `git annex lock`.)
When you commit an unlocked file, all that gets committed to git is a
pointer to the content. The content of the file is stored by git-annex.
$ echo "now smaller, but even cooler" > my_cool_big_file
$ git commit my_cool_big_file -m "changed an annexed file"
add my_cool_big_file ok
[master 64cda67] changed an annexed file
1 files changed, 1 insertions(+), 1 deletions(-)
For more details on working with unlocked files vs the regular locked
files, see [[tips/unlocked_files]].