dify 官方仓库: https://github.com/langgenius/dify/
下载 dify 和建立 git 仓库
# 先 clone 最新版本,体积小,不容易出错
git clone --depth 1 https://github.com/langgenius/dify.git
# 更新完整历史
git fetch --unshallow
# 添加官方仓库为 upstream(用于同步更新)
git remote add upstream https://github.com/langgenius/dify.git
# 移除默认的 origin,添加自己的 git 仓库
git remote remove origin
git remote add origin git@github.com:xxxx/dify.git
建立自己的项目分支
假如你的项目叫 mimo
# 创建 mimo 分支。后期修改都在这个分支做。
git checkout -b mimo
# 将代码推送到远程服务器上
git push -u origin mimo
开发日常
# 切换到 mimo 分支
git checkout mimo
# 修改代码后,提交代码
git add .
git commit -m '修改 ui界面,替换 logo 等'
# 推送到服务端
git push
同步更新
# 切换到 main 分支
git checkout main
# 拉取官方最新的代码
git pull upstream main
# 推送更新后的 main 分支
git push origin main
# 切换到项目分支
git checkout mimo
# 合并 main 分支
git merge main
