Learning Git (1)
This article introduces Git for the beginner.
Contents
Requirements
Learning and using Git requires:
- An account with a Git hosting service
- Or, run your own Git server
- A Git client, for example GitHub Desktop.
Git hosting services
See GitHub.
Git clients
See Git client and GitHub Desktop.
Git servers
See Git server.
Command line
Getting a git repository
You can get a Git project using two main approaches.
- The first takes an existing project or directory and imports it into Git.
- The second clones an existing Git repository from another server.
Initializing a Repository in an Existing Directory
If you’re starting to track an existing project in Git, you need to go to the project’s directory and type:
$ git init
This creates a new subdirectory named .git that contains all of your necessary repository files – a Git repository skeleton.
At this point, nothing in your project is tracked yet. (See Git Internals for more information about exactly what files are contained in the .git directory you just created.)
If you want to start version-controlling existing files (as opposed to an empty directory), you should probably begin tracking those files and do an initial commit. You can accomplish that with a few git add commands that specify the files you want to track, followed by a git commit:
$ git add *.c $ git add LICENSE $ git commit -m 'initial project version'
Source: https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository
Typical process
- git pull
- git add
- git commit
- git push
Terminology
See also
External links
GitHub links:
General links:
- Get Started with Git - Al Shaw November 02, 2010
- Getting Started with Git - Karen Baker
June 06, 2013
- Ry’s Git Tutorial
- Got 15 minutes and want to learn Git? - interactive tutorial
- Git Cheat Sheet
- Git for Beginners
- Getting Started with Git: The Fundamentals
- Getting started with Version Control @ Stack Overflow
- Git tutorial @ git-scm.com
- Getting Started @ git-scm.com
- Git Basics @ git-scm.com
- Git Basics @ Team Treehouse
- Git for Beginners - Lauren Norsini
- Quickly Get Started with Git
- Starting With Git!
- [Good Resources for Learning Git and GitHub]
Videos:
- Getting Started with Git and GitHub - Derek Dahmer
- Getting Started with GitHub + Git @ YouTube
- How to Get Started @ YouTube
Bonus video:
- Please. Stop Using Git. - Matthew McCullough - speech by Matthew McCollough, inventor of Git