5 users online. Create an account or sign in to join them.Users
Update using GIT
This is an open discussion with 68 replies, filed under General.
Search
git fetch && git pull
Done :)
As a designer and not much of a programmer, I’m completely lost at git, I have to admit. I had heard a lot of talk around the community about it, but even after doing some Google searches, I’m still lost. How would one go about using git from the beginning? I’m still stuck in the 20th century using FTP to connect to my shared web host.
I think you have to use SSH on your webhost to use git? It looks like on mine I have to send them a copy of my I.D., is that normal? Does anyone know of any really basic tutorials to get me started?
@TheJester12: Have you read Git for Designers? Start there and maybe you get a grip of it. You have a lot of resources at gits official website aswell.
Are you using Git to update right on the server? Or do you have to update on your local computer and sync/ftp? It’s pretty confusing to me too.
Are you using Git to update right on the server? Or do you have to update on your local computer and sync/ftp? It’s pretty confusing to me too.
You can do either. Currently, I have msysgit installed to do it on my computer and upload the changes via FTP. It comes with a GUI or you can do it old school with Bash.
Are repositories location dependent? In other words, if I clone Symphony to my computer and FTP everything up to my server, would I then be able to pull from the server if I decide sometime down the road I want to skip FTP?
Anywhere that you have a .git directory you have a working git repository. So, if you want to SSH into the server, you can do a git pull directly from there. Joyent Accelerators have Git installed, so you should be good to go (assuming that you are referring to those servers).
Anywhere that you have a .git directory you have a working git repository. So, if you want to SSH into the server, you can do a git pull directly from there. Joyent Accelerators have Git installed, so you should be good to go (assuming that you are referring to those servers).
Yes, I also wanted to know because I want to rearrange some folders on my computer and didn’t want that to break any of the repositories. From what you said it sounds like everything is self-contained and that the .git directory doesn’t have any location specific data?
By the way, I’ve done this by creating a branch called production where I make sure that the install.sql, install.php and update.php files are not included. Since we’re using a private Git repository, I’m also able to maintain a complete SQL dump file under version control to keep the development and production databases in sync.
From what you said it sounds like everything is self-contained and that the .git directory doesn’t have any location specific data?
Correct. That’s the beauty of a distributed version control system. Each repository is exactly the same, no matter what the location.
But there is a difference between the “master” repositories and the “satellites”. These probably aren’t official Git terms, it’s just the way I understand it. (Though, I could be wrong about this. This is just from trial and error.)
I did find out the hard way that you can’t treat any repository as a “master repository”. That is, you can’t arbitrarily select another repository with a working directory and start pushing commits to it. You still need a bare repository to push to, from which all others can pull. For private repositories, I just followed the instructions from Joyent for setting these up, then I was able to have a private repository on our local network at work, but still have an offsite backup of the work that I had free access to outside of our local network. So, I just made sure to push to both repositories to keep these two master repositories in sync.
I’m also able to maintain a complete SQL dump file under version control to keep the development and production databases in sync.
Holy crap Batman! Why didn’t I think of that :-)
Perhaps you could elaborate on the SQL repository.
For what it’s worth, at Airlock I devised a cunning way to move structural changes between Symphony builds without touching the content. By logging every SQL query that goes through the Symphony core you can deduce which are structural (fields, sections, pages) and which are content (edits to entries). This means we can develop locally on a shared database, then push all structural changes to staging/development machines, without touching live content.
It needs a slight change to the class.mysql.php file in the core but the rest is an extension. We’ve used it for a few months now and it’s pretty stable. Unless bauhouse has any other ideas, I may get time to post it up soon.
I’d be very interested in that nick, as I work on multiple computers in different locations - it’d prove very useful. :)
I would be interested in it too provided that this slight change in the core can/should be added in the next minor point release.
It’s very much a proprietary change to the core, specific to the extension. It fills a void where a delegate could be used, only, a delegate in this instance would be ludicrous (firing every time a single query is made). Anyway, not wanting to hijack this thread, keep your eyes peeled for another thread this week.
@bauhouse, still very interested in your method.
My method is very manual. Using phpMyAdmin to dump the local database, save the file, commit to Git, then whenever I need to sync to production, grab the complete SQL dump and run the SQL in phpMyAdmin on the production server.
So, I have a directory called _configuration that contains the config.php files for localhost and production as well as the MySQL dump file to sync the databases:
_configuration
localhost
config.php
production
config.php
mysql
db.sql
Edit: This would exist in the dev branch, rather than the production branch.
This process does not take into account a situation of managing live content in the way that Nick describes. I’m using it more for deploying primarily static content for prototyping.
This process does not take into account a situation of managing live content in the way that Nick describes. I’m using it more for deploying primarily static content for prototyping.
Got it. Thanks for the explanation!
Create an account or sign in to comment.
I thought GIT was to difficult at first but I just updated one of my sites for the first time using GIT and I must say, wow! If you’ve been doing it old school like myself, change your ways now. I can’t believe how simple it was to update to 2.0.6.