preloader
blog-post

How to add existing folder to git

In this article we will see the steps to add an existing folder to git

  • Create an empty Git repository or reinitialize an existing one

    git init
    
  • Add file contents to the index

    git add .
    
  • Commit changes to the repository

    git commit -m "initial commit"
    
  • Add a remote

    git remote add origin <remote-repo-url>
    
  • Show URLs of remote repositories

    git remote -v
    
  • Push the changes to remote repo

    git push -f origin master
    
Share this blog:
Comments

Related Articles