Question: I made some bug fixes to an open source project on my local machine. I pushed the code to my github account then initiated a pull request (from? for? to?) the original author of the code. 

Why does my username show up as "ubuntu" on github? I did push from an Ubuntu machine, but under no circumstances do I want anyone on github to know my operating system or username. In this case both were revealed. 

Why on earth did this happen and how do I prevent it?

Github says something about associating my email address with my account... I didn't push from an email address. I'm so confused.

Answer: 
When you did your commit, there was probably a message that there was no Username associated with the repo. So it used the name of your account/computer as the user that made the commit. If you do a `git log` in your local repo, you should see `Author: Ubunut` in the commit.

You can set an Username/Email with:

```
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

```

This will set the Name and email for all the repos that you have. If you want to change it for a specific one just drop off the `--global`

<http://git-scm.com/book/en/Customizing-Git-Git-Configuration>
Guarav's answer is great, but to update the name on previous commits you can use the following:

```
git commit --amend --reset-author

```

*Edit 1 after this*

Okay - this will work ONLY on the previous commit that you have done.

So say you did a commit that had the wrong user.name and/or user.email set:

The first you would know this by doing a:

```
git log

```

and it would show the user name or e-mail as being something you did want. So now you use:

```
git config --global user.name "The Right Name"
git config --global user.email "The Right Email address"

```

So now this will be correct for future commits. But to fix the previous commit:

```
git commit --amend --reset-author

```

Will cause the user name and e-mail on the VERY LAST COMMIT to be what your current user.name and user.email are set to.

GIT has an amazing lot of functionality, and will allow you rewrite history - to the extent of even adding files that you forgot to put in a commit, and a whole bunch of things. However, this functionality comes with the price that THERE IS NOT JUST A SIMPLE PLUG AND CHUG COMMAND to
do what you want. Rewriting git history is something that takes thought -- you need to know what you are doing and why you are doing it, so I suggest that you look at some Git documentation or tutorials about it so that you can understand how to do it. Here is a link that could help:

[Git Tutorials and Training | Atlassian](https://www.atlassian.com/git "Git Tutorials and Training | Atlassian")