简体   繁体   中英

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!! (This is my problem).

Example:

  1. I create a new branch and I make changes in different files of this branch. In this moment other people of my team did changes and he did a push to master branch. And is necessary upload these files to FTP Server.

Then...

I put the followings commands in "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.

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!!! Is this Possible??

Thank's

You can just do :

git add .
git commit -m "My changes"
git checkout master
git pull origin master
  • 1 and 2nd commands commit your changes to MyBranch
  • 3rd switch your working branch to master
  • 4th get the latest remote version of master

Then you can do your rsync upload to your server. It will contain the most recent version of 'master' ie master with your team changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM