How to save our changes to our forked repository?

To add all the changes we made in our code to the local repository, we need to log in to our Github account in Git Bash and run the following command in Git Bash:

git add .
git commit -m "test commit"
git push -u origin "branch name"

If the branch name is master, then the last command would be:

git push -u origin master

This successfully copies all the updated files to our forked repository. We can also add files selectively using the specific file name which we want to push in our forked repository. We can check the files which are updated by running the command:

git status

This shows all the files that are updated by the user which are yet not committed. If the file name is “upgraded.js”, then the command will be:

git add upgraded.js
git commit -m "saving changes"
git push -u origin "branch name"

How to Push a Project and Contribute on GitHub?

GitHub is a powerful platform for hosting and collaborating on code repositories. Whether you’re working on an open-source project or collaborating with a team, knowing how to push a project and contribute on GitHub is essential. This article will guide you through the steps to push your project to GitHub and make meaningful contributions.

Table of Content

  • Setting Up Git and GitHub
  • Pushing a Project to GitHub
  • How to contribute to a repository?
  • How to save our changes to our forked repository?
  • How to create a pull request to the original repository?

Similar Reads

Setting Up Git and GitHub

Before you can push a project and contribute, you need to have Git installed on your machine and a GitHub account....

Pushing a Project to GitHub

Once you have Git and GitHub set up, you can push your project to a GitHub repository....

How to contribute to a repository?

First of all, we need to fork the repository on which we want to contribute to our own Github account. It can be done by clicking the fork option near the top-right corner of the repository....

How to save our changes to our forked repository?

To add all the changes we made in our code to the local repository, we need to log in to our Github account in Git Bash and run the following command in Git Bash:...

How to create a pull request to the original repository?

Only after we made certain changes and upgradations in our forked repository, the option to Open pull request will be visible on clicking Contribute button that indicates that your forked repository has some commits/upgradations that are yet not added to the original repository. Click on the contribute button, and it will open a page that allows us to open a pull request and set the name of your pull request, and you can write some additional description about the changes made. After submitting the pull request, the request is sent to the maintainer/owner of the original repository, which may be accepted if the maintainer likes the changes/upgrades made by us....