# git

### Good Articles

* Simple list of git commands - <https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging>
* Git Rebase - <https://jeffkreeftmeijer.com/git-rebase/>

### How to Use Pull requests search filters

&#x20;Source: <https://help.github.com/enterprise/2.10/user/articles/searching-issues-and-pull-requests/>

* To view the PRs that were closed with out merging

  `is:pr is:unmerged state:closed`
* To see PRs that were closed without merging after a specific date

  `is:pr is:unmerged state:closed closed:>2018-04-01`

## How to Set the Correct Email to GitHub account

When you switch between the public github and Intuit github, you may have trouble seeing the correct user associated with the commits. In order to avoid this mismatch, you need to set the correct git user BEFORE you make the commits.

**Command to see the currently configure user**

```sh
git config --global user.email
```

Replace `user.email` with your actual email address like so: `git config --global user.email "your_email@example.com"`.

**Command to see all local configuration (can be run only from a git repo)**

```sh
git config --local --list
```

### The Best Solution <a href="#the-best-solution" id="the-best-solution"></a>

Configure the local repos pointing to public GitHub to use Gmail address. Configure global value to be corporate email address. (Or the other way around)

```sh
cd ~/dev/GitHub/my-learnings git config --local user.email <your-pers-email>
git config --global user.email <your-corp-email>
```

#### Result:

```sh
git config --local user.email ==> your-pers-email
git config --global user.email ==> your-corp-email
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.annjose.com/git.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
