Posted by bhosmer on January 28, 2012 at 11:21am
For those of you that missed our recent meetup with David Rogers where he gave a great introduction to git, Randall Schwartz has posted his two-hour long talk that he recently gave: http://vimeo.com/35778382

Comments
Very Timely!
Git and me... we're still trying to get along. :-)
Thanks Ben!
This will make it easy!
Check out: http://gitimmersion.com
This may be much easier to digest. Just follow the steps.
If you have any points that
If you have any points that you are getting stuck with, just ask.
Thanks! I have the basics
Thanks! I have the basics down but it gets all mixed up because I committed the wrong files. (Namely, settings.php) I have cloning down, status, add and commit... but I don't fully know how to use the editor (or even which one it is) and I can't find where anyone tells you what specific files do and don't need to be committed. For instance, at one point Git suggested I use "git add ." and I ended up transferring everything! Heh!
Backtracking after a mistake like that is even worse.
I've found some great instructions online (including GitImmersion, thanks!) but I'm working on making some git instructions of my own in order to learn it all better.
Are you using Drush?
Are you using Drush as well? I am asking because it made my life a lot easier when I need to keep our sites in sync. He touches on settings.php when he goes in rsync. Check out Mike's video from Drupalcamp Atlanta if you haven't already: http://vimeo.com/30476215
Be careful with git add . Try
Be careful with git add .
Try git rm /sites/default/settings.php to remove this file from being tracked. Keep in mind, git just tracks the changes you make to files, it doesn't actually change the files.
No Drush yet...
Sshakir: I have not tried Drush yet. I have the program but have not had the opportunity to work with it yet. Thanks for the link!
Ben, I'm not using 'git add .' anymore! Heh! Learned that lesson. Backtracking is not a fun way to learn but it's pretty effective. I realize that it's only the changes that are being sent but Git doesn't care if you should send them or not. Git status simply lists ALL the changes and I didn't know which ones were correct to send. I was working on a D6 to D7 migration so pretty much everything had changed. See what I mean? I didn't know that normally, I would only be adding changes to the modules or themes files.
I'm getting there. Thanks for the help!
No problem. It sounds like
No problem. It sounds like you are making some quick progress now.
Often, we will add /sites/default/settings.php and sites/default/files/* to a .gitignore file, that way you can't accidentally add them and push them.
Here is a sample .gitignore:
# Ignore configuration files that may contain sensitive information.
sites//settings.php
# Ignore paths that contain user-generated content.
sites//files
sites//private
tmp
You can add this as a global .gitignore or you can simply add a .gitignore file to your root directory. Git will ignore any files that are listed.
I'm liking .gitignore a lot...
I fully understand the .gitignore file but at first, I didn't know what files should go into it. Ya know? I'm learning though. :-)
(git status is a fave too. )
Stuck
Hello:
How do I save and exit while in the editor within terminal?
To explain further, in the Git Immersion tutorial I am stuck on the 8th Lab: using the editor to include a message with a commit rather than using -m.
I have executed $ Git commit and the editor within terminal reads as follows:
Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit.
On branch master
Changes to be committed:
(use "git reset HEAD ..." to unstage)
#
modified: hello.rb
#
The tutorial says to type “Using ARGV”, then to save and exit the editor. I am not sure what commands to use to save or exit. Please help. Thank you.
I did not change the editor variable first (not sure if this is a problem
@SawyerMerchant save and
@SawyerMerchant save and exit would depend on what editor you are using. If it's a commit message that you are trying to commit you can specify the editor with something like
git config --global core.editor your_editorYou can use something outside of terminal like Textmate as far as I know. As for the file you are talking about adding an argument to you may want to just edit these in your preferred editor if you have a default set you can just do
open hello.rbbut if not and you want to pick up something else to learn
http://staff.washington.edu/rells/R110/
Using vi you enter text mode with i then esc to get out then :wq to write and quit.
Or you can take a look at nano
http://www.nano-editor.org/
With nano I think you can just do control x then y
It is quite possible that
It is quite possible that your default text-editor is vi. You would first hit esc then type :wq and enter. Or you can use ctrl c to cancel a command.
Thank you
That did the trick
Which one? ctrl c or :wq ?
Which one? ctrl c or :wq ?
:wq
:wq
I am guessing you are most
I am guessing you are most likely using a mac. The default text editor is vi (pronounced vee-eye).
You can avoid this by using "git commit -m "Your commit message"
Or you can set a different text-editor to be your default.