Set SVN and git to ignore Mac. ds_store files

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.