DEV Community

Cover image for How to push your code into github.
Arun Krish
Arun Krish

Posted on

How to push your code into github.

First of all, after you cloned a repo or for working on a new feature, its better to create a new branch and start working on that.

git branch branch-name
git branch navbar
Enter fullscreen mode Exit fullscreen mode

Edit your file and add; commit your changes.
git terminal

git add .
git commit -m "commit message"
git commit -m "navbar added"
Enter fullscreen mode Exit fullscreen mode

For every push, you want to ensure that your codes are committed. Now you can push your code to github and create a pull request.

git push origin navbar
Enter fullscreen mode Exit fullscreen mode

Note: If your github account is not connected to your IDE, you need to give the username as well as password of your github account. Your password while pushing is not your password for your github account. For that, you need to create a PAT: personal access token.

It takes a little time to push. After pushing open github, you can see a button showing to create a pull request.

GitHub pull request button
By clicking "compare and pull request," you will go to the next page, where you can give a title and description for your pull request and press "create a pull request.". Congratulations! You created a new pull request.

You can see if there are any conflicts or not.

GitHub

Thank you
Happy coding:)

Top comments (0)