Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
97 lines (58 sloc) 2.14 KB

New to git?

Useful links

Quick guide

When I switched to git I got used to a specific git workflow, inspired by my previous experience with subversion. These are just a handful of commands and a tiny bit of git's full capabilities but it may be useful for you as well. (by Johannes Raggam)

Global Settings

Essential

$ git config --global user.name "USERS NAME"
$ git config --global user.email USERS@EMAIL

Create global gitignore

$ echo -e "*.mo\n*.pyc\n*.pyo" > ~/.gitignore
$ git config --global core.excludesfile ~/.gitignore

Cloning

$ git clone git@github.com:USERNAME/REPOSITORYNAME.git

Creating

First, create a github project on github.com collective

Second, create a project on your local computer and initialize it

$ mkdir PROJECT
$ cd PROJECT
$ git init # initialize git versioning in current directory
$ git remote add origin git@github.com:collective/REPOSITORYNAME.git

These settings will let you push with just "git push" as command

$ git config branch.master.merge refs/heads/master
$ git config branch.master.remote origin

Create local gitignore

$ echo -e "bin\ndev\ndevelop-eggs\neggs\nparts\n*.egg-info\n.*
    \n!.gitignore" > .gitignore

Add files, commit and push

$ git add . # add current dir and subdirs to project
$ git commit -am"MESSAGE" # commit all staged changes
$ git commit FILE -m"MESSAGE" # commit FILE
$ git push # push changes to master on github

$ git pull # update
$ git fetch # or so

Some more useful resources

Something went wrong with that request. Please try again.