What's the best way to checkout selected files and folders from a bare git repository on linux?

五迷三道 提交于 2019-12-06 06:16:06
VonC

that doesn't solve knowing the branch name

Regarding that, a post-update hook can detect the branch being pushed.
See:

Something like:

#!/bin/bash

while read oldrev newrev ref
do
  branch=`echo $ref | cut -d/ -f3`

  if [ "master" == "$branch" ]; then
    ....

Solve this with plumbing:

GIT_WORK_TREE=deploy/path GIT_INDEX_FILE=manifest/path \
        git read-tree -um commit:web_files_and_folders
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!