Git repository clone new or add to existing local project

GIT is an amazing code versioning tool. Well if you are new to GIT and wondering how to clone GIT repo locally to new folder or to the exising code folder.
Humm… Here are two methods, use according to your need.

Method1:ย Existing project

  • Step 1: Switch to your repository’s directory
    • cd /path/to/your/repo
  • Step 2: Connect your existing repository to Bitbucket
    • git remote add origin git@github.com:danyal14/someProject.git
    • git push -u origin master


Method2: Starting from scratch

  • git clonegit@github.com:danyal14/someProject.git
  • cd testecho "# My project's README" >> README.md
  • git add README.md
  • git commit -m "Initial commit"
  • git push -u origin master

Thats it and you are good to go.

Author: Danyal
I'm a skilled programmer specializing in Vue.js/Nuxt.js for front-end development and PHP Laravel for back-end solutions. I have a strong focus on API design and development, complemented by experience in web server setup and maintenance. My versatile expertise ensures seamless creation and maintenance of web applications, covering everything from intuitive user interfaces to robust server-side functionality. Passionate about coding and driven by a lifelong learning mindset, I invite you to explore more at danyal.dk.