GIT Crash Course 101

The crash course for using GIT – master these commands and you’ll be on your happy way to a new world of source control young Jedi…

# Initialise account
# Configure GIT name
git config –global “Your name here”
# Configure GIT email
git config –global “”

# Cloning a repo for the first time
git clone git@gitserver:project.git

# Fetching data from repo
git pull origin master

# or just updating the local repository
git pull

# Steps for adding and committing a new file
# Adding a file to local repository
git add testfile.php
git commit -m “Test information file comment” #(mandatory)
# Committing changes from local repo to central repo
git push origin master

# To amend user details
git commit –amend –author=’mm’

# Overwrites a file by checking it out from repo
git checkout testfile.php


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s