Claude Code for Product Designers
Lesson 15 of 49, 0 of 49 lessons completed
Sign in
Watch on YouTubePlay

Plays from YouTube. Google's privacy policy (opens in a new tab) applies.

Up next

2.1 Git in one picture

Next lesson in 8 s

1.10 Your first commit

Adam sets up his git identity in the app's terminal, then has Claude squash the commits it had already made into one initial commit under his name, and checks the history with git log --oneline.

What you'll learn

  1. A commit saves a version to history, with your name and email on it.
  2. Check your git identity with git config --global --list.
  3. Set user.name and user.email once per machine (--global); use the email of your GitHub account, or the one you'll sign up with.
  4. Claude may already have committed in the background; that's fine.
  5. Before anything is on GitHub, you can squash commits (rewrite history) safely.
  6. Check the history with git log --oneline.

Chapters

  1. 00:00Checking your git identity
  2. 01:42Setting your name and email
  3. 04:25Squashing Claude's earlier commits
  4. 06:39One clean commit on main
  1. 00:00Okay, our first implementation is ready.
  2. 00:02Before we wrap things up in this module, let's make sure our work is properly saved, meaning committed, meaning saved to a version history.
  3. 00:11Now, we are going to unpack a lot of the things related to working with Git in the next module.
  4. 00:16So, consider this video to be a bit of a teaser.
  5. 00:19Um and what I want to do is I'll want to make our first official commit.
  6. 00:24Before I can do the first official commit, I want to make sure that I'm going to be committing as myself.
  7. 00:31Uh so I want to basically check my identity, how it is set up on this machine uh for the sake of making the first commit because, you know, once
  8. 00:40I make the first commit, it's going to be basically assigned to me, meaning it's going to have my name on it and it's going to have my email address
  9. 00:47on it. So, the first thing that I'll want to do is I'm going to head back to Claude Code desktop application.
  10. 00:53I'm going to focus on the main session um and then I 'm going to open up a terminal.
  11. 01:00And um this is a cool thing you can do as well, by the way, because chances are if you have been using Claude Code before, if you've been, you
  12. 01:07know, vibe coding with other tools, there might have there there might already be some sort of uh Git identity configuration.
  13. 01:14So, in order for us to double check, let's type in a command that goes um Git config.
  14. 01:20Um I have my cheat sheet over here.
  15. 01:22Uh global list. Okay, let me make sure there are no typos.
  16. 01:26Great. Okay. So, in my case, um I am getting no such file directory, meaning yes, I don't have any sort of Git identity or Git configuration on my computer.
  17. 01:37Now, if you see anything else, such as your name or email address coming up, it means like your Git identity is set up properly.
  18. 01:45Uh now I'm going to because this is a fresh install, I'm going to set up my Git identity.
  19. 01:50And here is a tip.
  20. 01:51Um we'll have to set up our name and our email address.
  21. 01:54And I'm going to set up an email address that matches the GitHub account, which I have, that I will want to use for the purpose of my future work
  22. 02:05with Git. So, if you have a GitHub account already, just make sure that over the next couple of steps I'm going to show you in a second, you're going
  23. 02:13to use that email address.
  24. 02:14If you don't have any GitHub account, think about which email address you're going to use to set up one and make sure to set up this email address.
  25. 02:21We can revert it and change it at any at any time, but this is just a good moment to do so.
  26. 02:26So, uh let me take another look at my cheat sheet um and I'm going to first start by setting up my Git name.
  27. 02:33So, I'm going to say Git config uh global uh username and over here I'm going to type in my uh just my full name.
  28. 02:44This is like a convention.
  29. 02:46So, I'm going to do Adam um Uh let me make sure there are no typos.
  30. 02:55It's not uh it's not an easy last name to live with.
  31. 02:59[laughter and gasps] Okay, so I'm I've to hit enter and no response means good.
  32. 03:03Uh and then I'm going to uh configure my email address.
  33. 03:07So, I'm going to go Git config uh global and then I'm going to do user email and then I 'm going to type in my email address.
  34. 03:18Uh I'm I hope I'll remember to blur it out.
  35. 03:24Okay. Let me make sure there are no typos.
  36. 03:29Okay, looks good. Okay.
  37. 03:31Now uh one important thing to flag, you might be wondering, you know, what is this global flag here?
  38. 03:36Global meaning we are setting up our Git identity globally for my for our entire machine, meaning um you know, next project we open up and we make, you know,
  39. 03:48commits and we, you know, work with Git, it's all going to be attributed to this uh full name and this email address.
  40. 03:55It is possible to set out to set different Git identities in different projects, but for the purpose of this video course, I'm going to assume that we're going to
  41. 04:04have one identity for our entire machine, okay?
  42. 04:07[snorts] Um, perfect. And then I'm going to go back to one of the previous comments which we had, which is git config global list.
  43. 04:15And I can see both my username and user email are now present and set up properly.
  44. 04:21Great. So I'm going to close this terminal.
  45. 04:23I 'm going to close this window as well.
  46. 04:25And then uh I'm going to come back to this session.
  47. 04:28I 'm going to help ask it to help us with our first comment.
  48. 04:32Now here's a little bit of a confession.
  49. 04:35Turns out this cloud session has been already committing quietly in the background and there are five comments already, which is nothing to be worried about.
  50. 04:46I'm just going to squash these comments.
  51. 04:48We are basically going to rewrite the history and that is totally possible and it's, you know, especially easy when we don't have any GitHub repository connected to this folder
  52. 04:58just yet, which we don't.
  53. 05:00So what I'm going to do is I'm just going to say this.
  54. 05:04Claude, um I would like to make our first official initial comment.
  55. 05:10If you have made any comments before, make sure to squash them and please make a new official init comment with my freshly set up git identity.
  56. 05:22Okay, let me make sure there are no typos here.
  57. 05:25This is important. Uh okay.
  58. 05:28If you have made any comments, right, before, make sure to squash them and please make a new official init comments with my freshly set up git identity.
  59. 05:39So for some reason, uh you know, the voice recognition recognition seems to be uh catching up comments, not comments.
  60. 05:46Okay. So um this is a problem that I would also encourage you send in case your Claude has also been quietly making comments before.
  61. 05:55So I'm going to send it and um let's see let's see the response.
  62. 06:02Okay, so it's going to check the git identity.
  63. 06:06It's going to check the history.
  64. 06:09Um, it also said it's going to check the remote.
  65. 06:12Uh, again, remote is something we're going to cover in the next um in the next module.
  66. 06:17Uh, basically if there is any GitHub repository connected with this or any other repository that is out there online, there is none.
  67. 06:25Um, and um okay.
  68. 06:32Perfect. Okay. Wonderful. So we have one commit.
  69. 06:41Uh, initial commit tonic parking authored by me with my new email.
  70. 06:45It holds 37 project files including the uncommitted desktop fixes and the mobile layout work.
  71. 06:52So the uncommitted meaning like the work from the previous sub session which is now committed uh and the old five commits in my case uh are kept on a
  72. 07:00backup branch. Okay, um I don't really need a backup branch in case that's what your Claude did.
  73. 07:06I'm going to just say let's delete the backup branch.
  74. 07:09Again, branches something we're going to cover in the next module.
  75. 07:13So uh after that branch is deleted, we are only left with one branch, main and one commit, initial.
  76. 07:21Okay, and just to confirm, I'm going to open up a git terminal again and I 'm going to type in git log one line uh just to keep things
  77. 07:32compact. Uh, okay, let's see.
  78. 07:37Oh, I typed in online.
  79. 07:39Git log one line.
  80. 07:42Okay. And in my case, it's showing just one commit and that is exactly how it should look like in your case.
  81. 07:51Um, which confirms that we are all good to go and we are ready to meet again in another module.
  82. 07:58Thank you so much.

The cheat sheet is for signed-in viewers. Inside: the lesson's prompts ready to reuse, the commands and shortcuts, useful links and what to watch out for.

Sign in to get the cheat sheet

Loading the cheat sheet…