Initializing a New Local Repository

Let's create a local repository that we can use to practice the next set of commands.

  1. Navigate to the directory where you will place your practice repo (cd .. to get back to the parent folder).
  2. Create a new directory and initialize it as a git repository: git init practice-repo
  3. CD into your new repository: cd practice-repo
  4. Create an empty new file named touch
  5. Add and commit the file.

Since we will be using this as our practice repository, we need to generate some files and commits. Here are some scripts to make this easier:


for d in {1..6}; do touch "file${d}.md"; git add "file${d}.md"; git commit -m "adding file ${d}"; done


for ($d=1; $d -le 6; $d++) { touch file$; git add file$; git commit -m "adding file$"; }

results matching ""

    No results matching ""