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?