Well, Felicia has an Doctor Who script she wants to share, so she navigates to the right directory and copies in her script:
And then Felicia adds the new script to the repo:
Now git knows the file exists. And any time Felicia wants share changes she has made to the script, she types:
-m command is just a message, so Felicia can explain what she did. We try to keep this short (under 50 characters).
This is the neat part. Git will keep a full record of Felicia’s latest script, but also all of the older versions. It will track the changes down and never lose them. Which can be quite handy if Felicia finds she has made a mistake and wants to go back and look at an older version.
After a couple of hours, Felicia has added a few new files, and made changes to a couple more. She is finally ready to share her changes with the group. So she types:
And now, since I also have a copy of the
SciFI repo, I can see all of Felicia’s changes by going to my own copy of the repo and typing:
(On tardis) Check out a copy of the repo:
(Not on tardis) Check out a copy of the repo:
Add a new file:
Make a change:
Share your changes:
Get everyone else’s new changes:
Here are a couple of common questions people have, after I have introduced them to Git.
Try doing a
git pull first. Git likes you to have an up-to-date copy of everything before you push.
Don’t worry about it. If you create a new file inside a new directory, git will automatically create the directory for you. (You can’t create an empty directory.)
If you don’t like the command line, you can use a Graphical Interface, after you’ve checked out the repository into your own area:
If you need more help, just look online, there are plenty of great resources out there for beginners: