Skip to content

Commit 101f239

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-devops-docs-pr into edit-pass-1
2 parents 9802894 + 54c0a7b commit 101f239

File tree

6 files changed

+196
-197
lines changed

6 files changed

+196
-197
lines changed

docs/repos/git/git-dates.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Dates in Git
33
titleSuffix: Azure Repos
4-
description: How dates work in Git
4+
description: Learn how dates work in Git.
55
ms.assetid: c5e233e2-cc84-4ca6-8ca3-8eb6d686533a
66
ms.service: azure-devops-repos
77
ms.topic: conceptual
@@ -16,16 +16,16 @@ ms.subservice: azure-devops-repos-git
1616
[!INCLUDE [version-lt-eq-azure-devops](../../includes/version-lt-eq-azure-devops.md)]
1717

1818
Git tracks two dates in commits: author date and commit date.
19-
In addition, Azure DevOps Services and TFS track when a commit was first pushed to the server.
19+
In addition, Azure DevOps Services and Azure DevOps Server track when a commit was first pushed to the server.
2020

21-
* **Author date**: when a commit was originally authored. Typically, when someone first ran `git commit`.
22-
* **Commit date**: when a commit was applied to the branch. In many cases it is the same as the author date. Sometimes it differs: if a commit was amended, rebased, or applied by someone other than the author as part of a patch. In those cases, the date will be when the rebase happened or the patch was applied.
23-
* **Push date**: when a commit was pushed to the remote repository in question. This date is specific to the remote version control system you are using, and won't be available in your local repository.
21+
* **Author date**: When a commit was originally authored. Typically, this date is when someone first ran `git commit`.
22+
* **Commit date**: When a commit was applied to the branch. In many cases, it's the same as the author date. It can differ if a commit was amended, rebased, or applied by someone other than the author as part of a patch. In those cases, the date is when the rebase happened or the patch was applied.
23+
* **Push date**: When a commit was pushed to the remote repository in question. This date is specific to the remote version control system that you're using and isn't available in your local repository.
2424

25-
When you run `git log`, by default you will see the *author date*.
26-
If you want to see commit date, you can use one of the many command line options, such as `--pretty=fuller`.
25+
When you run `git log`, the author date appears by default.
26+
If you want the commit date to appear, you can use one of the many command-line options, such as `--pretty=fuller`.
2727

28-
Let's look at a brief example to see these concepts in practice. First we will create a normal commit:
28+
Let's look at a brief example to see these concepts in practice. First, create a normal commit:
2929

3030
```
3131
git init
@@ -34,15 +34,15 @@ git add *
3434
git commit -m "A normal commit message"
3535
```
3636

37-
Now let's amend our commit with a different message:
37+
Now, amend that commit with a different message:
3838

3939
```
4040
echo again > file.txt
4141
git add *
4242
git commit --amend -m "An amended commit"
4343
```
4444

45-
If we look at our regular log history we would see something like the following:
45+
If you check the regular log history, information like the following example appears:
4646

4747
```
4848
git log
@@ -53,7 +53,7 @@ Date: Thu Feb 25 19:38:54 2016 -0500
5353
An amended commit
5454
```
5555

56-
Now let's view the same commit with the author date:
56+
Now, view the same commit with the author date:
5757

5858
```
5959
git log --pretty=fuller
@@ -66,21 +66,21 @@ CommitDate: Thu Feb 25 19:39:36 2016 -0500
6666
An amended commit
6767
```
6868

69-
Note the (slight) difference between the author date and commit date above.
70-
The author date is my original, unedited, commit time. The commit date is the time at which I ran the `--amend` command.
69+
Note the slight difference between the author date and commit date in the examples.
70+
The author date is the original, unedited commit time. The commit date is the time at which you ran the `--amend` command.
7171

72-
In fact, there are a lot of `git log` options to help you understand dates better.
73-
For example, passing the `--date` flag will allow you to determine how dates are displayed.
74-
This can be useful for normalizing time zones (git displays dates in their original time zone, by default) or changing the date display string.
72+
Many `git log` options can help you understand dates better.
73+
For example, if you pass the `--date` flag, you can determine how dates are displayed.
74+
This flag can be useful for normalizing time zones, because Git displays dates in their original time zone by default. It can also be useful for changing the date display string.
7575

76-
To learn more about the various formatting options, see the [git log man page](https://git-scm.com/docs/git-log).
76+
To learn more about the formatting options, see the [git-log man page](https://git-scm.com/docs/git-log).
7777

78-
## Changing Git Dates
78+
## Change Git dates
7979

80-
When you're getting ready to commit your code, note that you have the ability to set both the author and commit dates. This isn't something you should do often.
80+
When you're getting ready to commit your code, you have the ability to set both the author and commit dates. This ability isn't something you should use often.
8181

82-
You can change the author date of a given commit by passing the `--date` flag to `git commit`.
83-
There are various articles regarding the formatting of this flag, but the gist is that it isn't well-documented. [This StackOverflow question](https://stackoverflow.com/questions/19742345/what-is-the-format-for-date-parameter-of-git-commit) does a great job of explaining the acceptable date formats.
82+
You can change the author date of a commit by passing the `--date` flag to `git commit`.
83+
Various articles discuss the formatting of this flag, but it isn't well documented. [This Stack Overflow question](https://stackoverflow.com/questions/19742345/what-is-the-format-for-date-parameter-of-git-commit) does a great job of explaining the acceptable date formats.
8484

85-
You can also use the environment variables `GIT_COMMITTER_DATE` and `GIT_AUTHOR_DATE` to set the corresponding dates, as documented in the [man page](https://git-scm.com/docs/git-commit).
86-
If you need to go this route, use [this Stack Overflow question](https://stackoverflow.com/questions/454734/how-can-one-change-the-timestamp-of-an-old-commit-in-git) as a starting point.
85+
You can also use the environment variables `GIT_COMMITTER_DATE` and `GIT_AUTHOR_DATE` to set the corresponding dates, as documented on the [git-commit man page](https://git-scm.com/docs/git-commit).
86+
If you need to take this approach, use [this Stack Overflow question](https://stackoverflow.com/questions/454734/how-can-one-change-the-timestamp-of-an-old-commit-in-git) as a starting point.

docs/repos/git/git-names.md

+27-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Author names in Git
33
titleSuffix: Azure Repos
4-
description: How Git stores author names
4+
description: Learn how Git stores author names.
55
ms.assetid: 09e60acb-fa48-4843-9f5d-5dfed981f467
66
ms.service: azure-devops-repos
77
ms.topic: conceptual
@@ -12,54 +12,57 @@ ms.subservice: azure-devops-repos-git
1212

1313

1414
# How names work in Git
15+
1516
[!INCLUDE [version-lt-eq-azure-devops](../../includes/version-lt-eq-azure-devops.md)]
1617

1718
When you commit to your local repo, Git includes your name and email address as part of the commit.
18-
This can sometimes lead to confusion.
19-
The name and email on your commits may not match the identity you log in with on a Git host like Azure Repos.
20-
Further, you may have commits under several different names and email addresses even though you were the author for each of them.
19+
This behavior can sometimes cause confusion.
20+
The name and email on your commits might not match the identity that you use to sign in to a Git host like Azure Repos.
21+
You might have commits under several names and email addresses, even though you were the author for each of them.
22+
23+
## Why does your repo show multiple names for you?
2124

22-
## Why are there multiple names for me in my repo?
25+
Have you searched for your name on the [History](commit-history.md) page and found multiple, slightly different entries for yourself?
26+
You probably wondered how it happened.
2327

24-
Have you searched your name in the [History](commit-history.md) page and been surprised to see multiple, slightly different entries for yourself?
25-
You were probably left wondering how this happened and what you can do about it.
26-
The answer is simple: in different commits, your name was recorded differently.
27-
Maybe you have two different computers, one configured with your full name (e.g. Frances) and the other with the nickname you go by (e.g. Frank).
28-
Or maybe you have a home computer connected to your Microsoft Account (e.g. frances@outlook.com) and a work computer connected to your employer's Microsoft Entra ID (e.g. frances_t@fabrikam.com).
29-
It's even possible you changed your settings over time, so older commits have one name and newer commits have another.
28+
The answer is simple: your name was recorded differently across commits.
29+
Maybe you have two computers, one configured with your full name (for example, Frances) and the other configured with a nickname (for example, Frank).
30+
Or maybe you have a home computer that's connected to your Microsoft account (for example, `frances@outlook.com`) and a work computer that's connected to your employer's Microsoft Entra ID instance (for example, `frances_t@fabrikam.com`).
31+
It's even possible that you changed your settings over time, so older commits have one name and newer commits have another.
3032

3133
## Where does Git get your name and email?
3234

33-
Git stores your name and email address in its [config file](https://git-scm.com/docs/git-config).
35+
Git stores your name and email address in its [configuration file](https://git-scm.com/docs/git-config).
3436
This file can be at the system level, global to your account on your computer, or local to a repository.
35-
If a name and email aren't found in any of these places, Git will do its best to get this information from your operating system.
36-
Your details are included in the commit, marking you as the author of that commit.
37+
If Git can't find a name and email in any of these places, it tries to get this information from your operating system.
38+
Git includes your details in the commit to mark you as the author of that commit.
3739

38-
When you set up Git for the first time on a new machine, you may create a commit using Git's "best effort" information.
39-
Git will prompt you to set an explicit name and email address, and the new settings will be used for subsequent commits.
40-
This is a frequent source of one author having multiple names.
40+
When you set up Git for the first time on a new machine, you might create a commit by using Git's "best effort" information.
41+
Git prompts you to set an explicit name and email address, and it uses the new settings for subsequent commits.
42+
This change is often the reason why one author has multiple names.
4143

4244
## Where does Azure DevOps Services get your name and email?
4345

4446
Your details in Azure DevOps Services come from your [profile](https://app.vssps.visualstudio.com/profile/view).
45-
Your profile was originally populated from details in your Microsoft Account or Microsoft Entra account, but you may change these details yourself.
46-
When you edit a file in the web or complete a PR, Azure Repos supplies your profile details as the author of the commit.
47+
Your profile was originally populated from details in your Microsoft account or Microsoft Entra account, but you can change these details yourself.
48+
49+
When you edit a file on the web or complete a pull request, Azure Repos supplies your profile details as the author of the commit.
4750
This is another opportunity for your name or email address to be specified differently.
4851

49-
## How do I change my information in Git and Azure DevOps Services?
52+
## How do you change your information in Git and Azure DevOps Services?
5053

51-
In Git, you can run two commands to change your name and email address:
54+
In Git, you can run the following commands to change your name and email address. Replace the example values with your information.
5255

5356
```
5457
git config --global user.name "Frances Totten"
5558
git config --global user.email "frances_t@fabrikam.com"
5659
```
5760

58-
In Azure DevOps Services, you can update your profile by clicking your picture in the upper right corner and choosing [My profile](../../organizations/settings/set-your-preferences.md).
61+
In Azure DevOps Services, you can [update your profile](../../organizations/settings/set-your-preferences.md) by selecting your picture in the upper-right corner and then selecting **My profile**.
5962

60-
## How do I change the author displayed for past commits?
63+
## How do you change the author displayed for past commits?
6164

62-
If you've made a single change locally and it has the wrong author, you can amend that commit with new author information. Be sure to format it like this: `Name <email>`.
65+
If you made a single change locally and it has the wrong author, you can amend that commit with new author information. Be sure to format it as `Name <email>`, as shown in the following example.
6366

6467
```
6568
git commit --amend --author="Frances L. Totten <frances_t@fabrikam.com>"

0 commit comments

Comments
 (0)