Day 9 : How to Push local code to remote repo.

Day 9 : How to Push local code to remote repo.

Create a remote repo.Part 1

  1. Click on create new repo.

  2. Give name to your remote repo. and click on Create repository.

  3. You will get this kind of UI

  1. Now Go to you local repo. and initialize the repo.

     git init
    

  2. Now add the all files my command "git add ."

git add .
  1. Then make a commit on the repo., here m is for message.
git commit -m "first commmit"

  1. then define the branch.
git branch -M master
  1. Add your local code with the remote repo. by this command

     git remote add origin https://github.com/sidharthhhh/helloworld.git
    
  2. Then finally push the code to the master branch.

     git push -u origin master
    

  3. Now check the remote repo. file.

Conclusion

We finally understand how to create a remote repo. and how we can push our local file or code to remote repo.