Skip to content

mbjones/gitbasics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Git Basics

Why version control, and why Git?

versions

  • Save time
  • Make changes with confidence
  • Reuse your work
  • Collaborate with others

Some examples

A quick demo tutorial

Installing Git and related software

Mac OS X

  • Open 'Terminal'
  • Check if 'git' is installed
  • If not, install from: Git for Mac
  • Before running the first time, you must configure your name and email:
git config --global user.name "Matt Jones"
git config --global user.email "[email protected]"
  • Optional: Install TextMate, and configure it as the editor for git commit messages
git config --global core.editor 'mate -w'

Windows

git config --global user.name "Matt Jones"
git config --global user.email "[email protected]"
git config --global core.editor '"C:\Program Files (x86)\Windows NT\Accessories\wordpad.exe"'

Topics

  • Version control systems
  • Creating a repository
  • Adding and committing files
  • Working with remote repositories
  • Using tags
  • Branching and merging

Typical workflow

mkdir test
cd test
echo "This is a test file." > README.txt

# Initialize the git repository and start tracking files
git init
git status
git add README.txt
git status
git commit -m "Initial draft of README."

# Make some changes to the file and commit them
echo "===================" >> README.txt
git status
git add README.txt
git status
git commit -m "Added formatting."

# View the history of changes
git log
git blame README.txt

Working with remote repositories

Use git clone to copy a remote repository to your local host, and then use git push to write your changes back up to the repository.

git clone [email protected]:mbjones/pgame.git
git remote -v
git pull origin master
echo " " >> README.md
git add README.md
git commit -m "Added a newline to end of Readme."
git status
git push origin master

title: Git Basics author: Matt Jones

About

Notes from tutorial on basic use and operation of Git.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages