Don't stop, Git it, Git it

Events happening in the community are now at Drupal community events on www.drupal.org.
druroot's picture

We're trying to put together a good basic tutorial on git and I wanted to gather some community opinion here. If you're new to git, what initial questions do you have about how it differs from other version control systems? If you're an experience git user, try to think back to when you were a git n00b and remember the things you found confusing and post them here.

Whaddaya think peoples?

If you have no idea what git is, read on for a basic description...

Git is a Version Control System(VCS) that has recently been selected among several other candidate VCSs to control the source code for Drupal and all it's contributed modules. It's also a great way to manage the codebase for all of your Drupal sites. Git differs from many other VCSs in that it is distributed in nature, whereas systems like CVS or SVN require developers to be in touch with a master repository to do many important operations like making commits, reading logs, or doing diffs. Because of it's distributed characteristic, git is labeled as a Distributed VCS and grouped with other DVCSs like mercurial or bazaar. The system is very powerful, you have a lot of control over your commits and historical comments, you can branch and do merges at lightning speed, and since we're using it on D.O now, it's critical knowledge for any Drupal code writers.

If you want to learn more about git, post any specific questions here, and checkout our April 13th SDDUG meeting!

Comments

When I was getting started with git

druroot's picture

When I was getting started with git, I was a little confused about how things worked, there's certainly a learning curve...

Here are a few of the questions that I'd have asked, when I was getting started. Please add some more questions below so we know what points to cover in our talk.


I hear I should be branching a lot, what is the proper branching workflow?

What exactly is a remote? How do I create one and add it somewhere else?

What is the significance of the master and origin keywords?

What are the differences between a squash commit and a rebase?

How do I look at logs to find out what happened and potentially revert to a previous state?

Been using git 2 months now

zakiya's picture

Been using git 2 months now in contract work and I'm a much happier person than when companies were using SVN.

My original questions where just about how git was different from SVN from a practical point of view. Most of the tutorials on source control get way too in depth too soon or assume you're working on a project by yourself. As a themer my main concern was having the latest version of a codebase and getting my changes to other developers.

My current questions:
How do you install git on a remote server?
What does a script that would automatically push/pull changes look like?
How do you recover from a git error? For instance you committed a change on your local and git says that you need to discard your changes before merging. Is that where the squash comes in?

Thanks for this topic! I also want to say that even if you're new to building websites or what source control is all about you should come to this talk and don't be scared. Once git's installed on your machine its easy breezy and it will save you time and headaches - even if you typically build your sites solo.

Can we look at drush next?

gitignore

zakiya's picture

Another early challenge was setting up a system-wide gitignore to remove all those pesky .DS_store files.

Git workflow with drupal

Leon Kenton's picture

Hi,

Is it possible and what is the best way to use Git to push from 1 development server to a staging server? That are both inside the same box, also want to apply this method to update the site http://joemaller.com/990/a-web-focused-git-workflow and the production server once all is well locally.

I use the development server as my workstation, I can SSH into both dev and staging and production servers. And want a workflow that uses http://joemaller.com/990/a-web-focused-git-workflow

the problem I have is where to keep the main repo? As I will need to clone this to the development server to start the process, any advice please.

Hope this makes sense...

San Diego DUG

Group categories

Event Classifications

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: