Steps to introduce new changes to the project repository:
-
- The
git clonecommand is used to create a copy of a specific repository or branch within a repository. - HTTPS Example:
git clone https://github.com/Call-for-Code/Agrolly-Web.git - SSH Example:
git clone git@github.com:Call-for-Code/Agrolly-Web.git
- The
-
- Create a new local branch from the
main/masterbranch of the project to make your changes. - Example:
git checkout -b <branch name>
- Create a new local branch from the
-
- Add/Update your changes to the project.
-
git statuscommand shows the current state of your Git working directory and staging area.
-
- The
git addcommand adds new or changed files in your working directory to the Git staging area. - Example:
- Add all changes:
git add . - Add specific file changes:
git add <dynamic file path>
- Add all changes:
- The
-
git commitcreates a commit, which is like a snapshot of your repository. These commits are snapshots of your entire repository at specific times. You should make new commits often, based around logical units of change. Over time, commits should tell a story of the history of your repository and how it came to be the way that it currently is. Commits include lots of metadata in addition to the contents and message, like the author, timestamp, and more.- Example:
git commit -m "adding new changes"
-
Merge latest
mainbranch changes- Checkout to
mainbranch and pull latest changesgit checkout maingit pull
- Merge
latestmain` branch changesgit checkout <branch name>git merge main
- Checkout to
-
git pushuploads all local branch commits to the corresponding remote branch.- For a new local branch which is still not in the central repository use the command
git push -u origin <branch name>to push your changes for the very first time. Then after you use justgit pushcommand to push your changes for the same branch.
-
- Create a pull request to propose and collaborate on changes to a repository. Check the link to learn on how to create a PR for your changes in your branch.
- Add a reviewer to your pull request.