Skip to content
  • Repository & Cloning · Git & GitHub

Repository & Cloning

LearnViaNotes @learnvianotes· 1 min read

Creating a local folder copy of remote GitHub repositories.

Cloning a Remote Repository

To duplicate an existing remote repository hosted on GitHub down to your local machine, use the git clone command along with the HTTPS or SSH link:

Shell
git clone https://github.com/username/my-project.git

This command automatically does the following:

  • Creates a new folder matching the repository name.

  • Initializes a local Git database inside it.

  • Fetches all the history branches and commits.

  • Checks out the default branch (usually main or master).

  • Configures the remote source address as origin.

Basic Terminal Operations

CommandPurposeDescription
cd [dir]Change DirectoryNavigates into the specified folder.
lsList FilesLists all visible files in the directory.
ls -aList AllLists all files, including hidden files (like the .git folder).

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report