Technical Recipes

Wednesday 4, January 2012

Usually you need to get upstream changes to your forked repo. To do that, just execute these lines:

$ git fetch upstream
$ git merge upstream/master

First line gets changes for upstream and second one merge these changes into your forked repository.


Monday 19, December 2011

Github allows you to fork an existing project. This is very interesting for collaborative work. You can write your our code based on an original one without do it from scratch. Usually, you're going to push/pull from/to your repo. However, the original repo. will have changes so you can add those updates to your fork by running the following commands:

$ git fetch upstream
$ git merge upstream/master
tags: git

Thursday 15, December 2011

If you need to create a tarball file using your repository as source, you can do it using the argument archive from the git command. For example, the following command will create a tarball called pybsnux.tar.gz from the current branch of your repository:

git archive --format=tar --prefix=pybsnux/ HEAD | gzip > 
    /tmp/pybsnux.tar.gz
tags: git

Wednesday 7, December 2011

When you need to change a message for the last commit, you can execute the following command:

$ git commit --amend

Then the message will be displayed on your favourite editor and you can change it. After this process the commit will be executed automatically.

tags: git

Tags

My latest tweets

tweet @greggpollack Looking forward for it!!
tweet @gaalal Puerta del Sol, 19:30h #PrimaveraValenciana #yotambiensoyelenemigo
tweet Hoy más que nunca: Vergüenza me daría ser policía #PrimaveraValenciana
tweet Cuando el "enemigo" son los estudiantes y los periodístas, algo muy grave está pasando #PrimaveraValenciana
Buy me a coffee!! Coffee cup

Advertisment