Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.


Stack Overflow

The old fashioned way


July 6, 2010 – 4:27pm Git Basics

A cheat-sheet to reference while getting started with git.

1. Pull down a copy of the repository:

git clone <repository>

2. List available branches (on the remote server)

git branch -r

3. Create a new branch

git branch <branchname>

4. Switch to an existing branch

git checkout <branchname>

5. After you have made changes to your local files, you can review what has changed with:

git status

6. If you want to add a few of those changes files in your next commit:

git add <file>

7. Commit those changes files to your local ‘stage’ (doesn’t push them back up to the remote server)

git commit -m "Your message here."

8. Push your committed changes to the remote repository:

git push origin <branch>

9. Tag a snapshot of the code:

git tag -a <v1.2> -m "Tagging 1.2 with fixes for x,y,z"

10. merge changes from a branch to back to master

git checkout master
git merge dev
Posted by in  Web Development   |  

Comments are closed.