[英]Deploy with GIT and RSYNC
I have a question about GIT and RSYNC because I use these two commands for make a deploy but I want upload my files to a FTP server (production) of the files that I have in my master branch only!! 我有一个关于GIT和RSYNC的问题,因为我使用这两个命令进行部署,但是我想将文件上传到仅在master分支中的文件的FTP服务器上(生产)! (This is my problem).
(这是我的问题)。
Example: 例:
Then... 然后...
I put the followings commands in "MyBranch": 我在“ MyBranch”中放置了以下命令:
git add .
git commit -m "My changes"
git checkout master
git merge MyBranch
git pull origin master
and then I make a rsync to a FTP Server. 然后将rsync同步到FTP服务器。
I want make add and commit my changes in my branch for then switch to a master branch and make the pull for get the changes of my team and then realize the deploy. 我想要在分支中进行添加并提交更改,然后切换到主分支并进行拉动以获取团队的更改,然后实现部署。
In other words, I want upload to FTP only the files in the master branch!!! 换句话说,我只想将master分支中的文件上传到FTP! Is this Possible??
这可能吗??
Thank's 谢谢
You can just do : 您可以这样做:
git add .
git commit -m "My changes"
git checkout master
git pull origin master
Then you can do your rsync upload to your server. 然后,您可以将rsync上传到服务器。 It will contain the most recent version of 'master' ie master with your team changes.
它将包含“ master”的最新版本,即您的团队变更的master。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.