Steps to set up a Git repository and make an initial commit:

Steps to set up a Git repository and make an initial commit:

ยท

1 min read

  1. Create a new folder to contain the Git repository. This can be done through a file explorer or command line.

  2. Open a terminal/command prompt and navigate to the new folder.

  3. Type "git init" and press enter. This will initialize an empty Git repository in that folder

  4. Create some files in that folder, like README.md. You can create empty files from the command line using "touch filename"

  5. Add the files to the staging area with "git add ." The period adds all new files recursively

  6. Commit the files with "git commit -m "Initial commit"". The -m flag lets you provide a commit message in quotes after it.

  7. Check the status with "git status" to see no changes waiting to be committed.

  8. View the commit history with "git log" and you should see your initial commit there.

  9. You now have a local Git repository with an initial commit! You can continue to add files, make changes, commit them, and push to a remote repository when ready. Let me know if you need any clarification on these steps!

ย