Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up Git on Network and the copying to website

Tags:

git

I am a Git newbie and have a question about how I should set it up within the restraints of our environment, and hoping someone can help me out and let me know if my thinking is correct.

Our IT department would prefer not to have Git installed on our Staging Server, so we're thinking we'll have to use a network drive. The plan is this:

  • Git repository on network
  • Localhost development machines pull from network repository, make changes, push back to repository
  • manually copy from repository to staging web server (do you export a version or just copy the contents directly?)
  • IT does security testing and copies changes to production web server (we do not have access to production server)

Does this seem like a good plan and is this an okay way to use Git?

Thanks!

like image 841
Evil Robot Avatar asked Jan 23 '26 13:01

Evil Robot


1 Answers

This is definitely a good way to use git. I would very much recommend it. Using revision control at all is a very crucial key to staying sane while developing good code, and that's how it made its way onto the Joel Test. If the developers can control everything about their development cycle, that is also advantageous because that way there is no bottle neck in development. Also, IT being able to keep autonomy over there own systems sounds like a good idea as well. So it can be a win-win situation.

I would tag (with some arbitrary revision-number system) every single revision which you copy over to the staging environment -- or maybe not literally every revision you copy over, but there is no harm in over-tagging, and it would be very unfortunate if you under-tagged and cannot revert back to some other revision afterwards.

For copying files over to the staging server, I would look into a tool like rsync. That will make copying changes much more immediate than having to restart a whole copy. On the network drive, git checkout the exact revision you will want to copy over to staging, then do whatever testing you do on your end, and then tell rsync to sync the two computers (you will have to figure out rsync if you use it). So, yes, you will copy the files directly from the network server.

Also, consider the idea of having some file itself which marks the revision number (including the git SHA-1 hash) so that when the files get copied over to the staging server, you will know exactly which version is there.

Finally, here is another link to more information about git branching which may or may not help you out: a successful git branching model

--

post any comments below if you have any comments/questions.

like image 196
Alexander Bird Avatar answered Jan 25 '26 07:01

Alexander Bird



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!