DEV Community

Mehak Saini
Mehak Saini

Posted on

2

#4 Adding existing project to git repo

  1. Create a new Repo from the UI
  2. Navigate to current project directory from terminal and run the below commands.

Initializes the local directory as a git repo

git init -b main
Enter fullscreen mode Exit fullscreen mode

Add the url for the remote repo where the local repo will be pushed

git remote add origin git@github.com:<github-url>
Enter fullscreen mode Exit fullscreen mode

Pull changes from remote repo to local(.gitignore, READMe.md)

git pull origin main
Enter fullscreen mode Exit fullscreen mode

*Add the files to be committed *

git add .
Enter fullscreen mode Exit fullscreen mode

Commit

git commit -m "Initial commit"
Enter fullscreen mode Exit fullscreen mode

Push the changes to remote

git push origin main
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay