可以按照以下步骤在其他分支开发,然后最后合并到主分支的某个文件夹里:
feature_branch
,并切换到该分支:git checkout -b feature_branch
feature_branch
上进行开发,并在该分支上创建一个新的文件夹,例如 feature_folder
:mkdir feature_folder
git add .
git commit -m "Add new feature in feature_folder"
git checkout master
feature_branch
合并到主分支:git merge feature_branch
feature_folder
文件夹移动到主分支的某个文件夹中:git mv feature_folder/ path/to/destination/folder/
git commit -m "Move feature_folder to destination folder"
git push origin master
这样,你就完成了在其他分支开发,然后将更改合并到主分支的某个文件夹里的操作。