0

I and my colleagues are developing a website, and in my computer I created a repository, and my colleagues clone from my computer to develop.

My question is, when we finish the development, how can we use git to push to the distribute server?

I mean, if we copy the code to the distribute server its viable, but you know, if the remote server is use git to connect with my computer, it will be very convenient for us to manage, such as fix bug, add new functions to our project, then we just need push remote.


EDIT

we use python Django and vue develop our project. and, if the project is all static files, how to deal with it?

244boy
  • 3,994
  • 8
  • 30
  • 72
  • 1
    You're not saying what kind of technology your website is developed with but if it is more than just static webpages then you probably want to think about adding a full CI system. Also, having the central repository *on your computer* is probably not the best solution. Consider setting up a separate server that everybody clones from that the CI system would also clone from. The CI system would then validate/test your application before deploying it into production. – Lasse V. Karlsen Nov 03 '17 at 10:18
  • See my Edit. my friend. – 244boy Nov 03 '17 at 10:20
  • If it is static files, no ability/need to test/verify/validate, then you would still set up a central repository and probably just add a push hook on the central repository that copies master to production. There are existing questions here on Stack Overflow that talks about this. – Lasse V. Karlsen Nov 03 '17 at 10:22
  • Here's one for example: https://stackoverflow.com/questions/18804552/using-git-to-deploy-website – Lasse V. Karlsen Nov 03 '17 at 10:23
  • Why cannot you clone it to the remote server exactly how your colleagues cloned it from your computer? – karthzDIGI Nov 03 '17 at 10:56
  • Have a look at https://mikeeverhart.net/2013/01/using-git-to-deploy-code/ for one approach to getting static files into production – Jeff Richards Nov 04 '17 at 12:18

0 Answers0