小编Aur*_*ron的帖子

Bash脚本:以递归方式更改文件权限

我需要一个Bash脚本来更改目录和所有子目录中所有文件的文件权限。它的行为应如下所示:

for each file in directory (and subdirectories)
   if i am the owner of the file
      if it is a directory
         chmod 770 file
      else
         chmod 660 file
Run Code Online (Sandbox Code Playgroud)

我想这不是一个艰巨的任务,但是我对Bash脚本没有很丰富的经验。感谢您的帮助!:D

bash recursion file-permissions

5
推荐指数
1
解决办法
817
查看次数

如何从现有项目在本地主机上设置裸 git 存储库?

我有一个正在处理的新项目,我已经为此项目/目录创建了一个 git 存储库。该项目在我办公室的机器上,它始终在运行且可访问。现在我想从中创建一个裸存储库,我可以将其用作“服务器”以通过 ssh 从我的家用机器复制/复制到我的家用机器。我试过

git clone --bare project project.git
Run Code Online (Sandbox Code Playgroud)

它从我的工作目录创建了一个裸存储库,但没有为新的裸存储库设置远程或分支。但是当我切换到新的回购

git remote -v
Run Code Online (Sandbox Code Playgroud)

给我

origin /home/auron/project (fetch)
origin /home/auron/project (push)
Run Code Online (Sandbox Code Playgroud)

这基本上与我想要的相反。我怎样才能达到我想要的?

git localhost repository

5
推荐指数
1
解决办法
1389
查看次数

标签 统计

bash ×1

file-permissions ×1

git ×1

localhost ×1

recursion ×1

repository ×1