I.Command for displaying hidden Mac files:
Defaults write com. Apple. Finder appleshowallfiles-bool true
To hide a hidden Mac file:
Defaults write com. Apple. Finder appleshowallfiles-bool false
II.Delete. ds_store in the directory:
Find/path/to/files-type F-name ". ds_store"-print-delete
Or:
Find/path/to/files-type F-name ". ds_store"-print0 | xargs-0 Rm-RDF
III.Configure SVN to ignore the. ds_store file:
SVN propset SVN: Ignore ". ds_store"/path/to/Files
[Document http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.propset.html]
Or configure the global configuration file:
Edit ~ /. Search for global-ignores in the Subversion/config file and Add. ds_store
(Configure the svn repository to ignore the. ds_store file:
SVN propset-revprop-r head SVN: Ignore ". ds_store" http://svn.site.com/path/to/repository/project
But the svn repository by default does not allow the team revision property to be modified, so this command may not be executed and you need to edit a hook (http://www.qinbin.me/svn-hook-hook-introduction/) (http://www.zeali.net/entry/533) file that requires execution Permissions
An example is as follows (Windows ):
@ Echo off
Set repos = % 1
Set REV = % 2
Set User = % 3
Set propname = % 4
Set action = % 5
// Set the superuser. The superuser can modify others' logs. Others can only modify their own logs.
Set superuser = Username
// Only log SVN: log modification is allowed
If/I not '% propname %' = 'svn: log' goto error_propname
// Only logs can be modified. adding or deleting operations are not allowed.
If/I not '% action %' = 'M' goto error_action *
// Only allow users to modify their own logs
For/F "usebackq" % K in ('svnlook author % repos %-R % rev % ') Do @ set Var = % K
Set rightuser = 0
If "% 3" = "% superuser %" set rightuser = 1
If "% 3" = "% var %" set rightuser = 1
If % rightuser % = 0 goto error_user
Goto: success_exit
: Error_user
Echo only allows users to modify their own logs> & 2
Goto error_exit
: Error_propname
Echo only logs can be modified> & 2
Goto error_exit
: Error_action
Echo only allows log modification, does not allow adding or deleting operations> & 2
Goto error_exit
: Error_exit
Exit 1
: Success_exit
Exit 0
)
(SVN document http://svnbook.red-bean.com /)
IV.Use command lines to prevent. ds_store file generation
Defaults write com. Apple. Publish topservices dsdontwritenetworkstores true
V.For git usage:
Add. ds_store to the top-level directory of the database. gitignore File
Then git Add. gitignore
Git commit-M ". ds_store remove"
Global configuration method:
Git config-global core. excludesfile =/path/to/. gitignore
Then configure this. gitignore file, just like the. gitignore file under the configuration project directory.
From: http://bmanlog.sinaapp.com /? P = 32