Mostrando las entradas con la etiqueta git. Mostrar todas las entradas
Mostrando las entradas con la etiqueta git. Mostrar todas las entradas

20150325

Better commits with GIT - Different email addresses for different respositories

When people start using GIT, usually they signup in a service like github.com or bitbucket.org. To do so, they use their personal or business email accounts and then configure git clients accordingly with this.

The first thing you do when you start using GIT is to configure some basic variables in the GIT global environment. In other words, you setup your name and email address for all the projects you are going to work from now on.

This is how you do it unsing your terminal:

$ git config --global user.name "YOUR NAME"
$ git config --global user.email "YOUR EMAIL ADDRESS"

What does this means? Each time you do a commit, it will be signed with that information because it was configured in the global space.



This is good, right? Well it is, but if you are doing work stuff you should be signing your commits with your job's email, if you are doing personal stuff you should be using your personal information, or at least that's what I think.

To check those settings run this in your terminal:

$ git config --list

It's important to understand that GIT allows you to specify an email address on a per repository basis. Let's see how we do this.

Setting up your identity per repository.

The --global option will make this configuration visible to all the projects by default. You can override this setting project by project (if you are not doing it, you should).

If you use a graphical interface for your GIT repositories as Source Tree you can do it in the Settings -> Advanced Tab window, un-click "Use global user settings" and write down your information.



If you use a terminal, you can do this from your respository folder:

$ git config user.name "YOUR NAME"
$ git config user.email "YOUR EMAIL ADDRESS"

This information is stored in a .gitconfig file in your drive in the project folder. 

So double check this before starting a new project.

$ git config --list
user.email=diego@sapriza.net
user.name=Diego Sapriza

reviewd by @jorgesierra

20120809

Temporarily ignoring files

There is a lot of times that you want to ignore a file that was already committed in your git repo:
git update-index --assume-unchanged <file>
when you want to rollback this and start tracking changes again:
git update-index --no-assume-unchanged <file>
Read more about this: http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html


20111024

How to merge selected files from a branch in git

I've being learning git for some time and i love it, i will start blogging some tips and tricks about it.

First you need to bookmark this: http://gitref.org/

Now, how to merge selected files from a branch to my master branch?
Move to the branch you want to "merge to", and: