docs/CONTRIBUTING-gitflow.md
( You will see this on Top Right of Github Repository !)
<li><h3>Clone your fork to your local machine</h3></li>( Click on the Green Code button and Copy the link https://github.com/........ )
git clone <insert-link>
(NOTE: In Place of insert-link paste the link you copied)
Keeping Your Fork Updated In order to get the latest updates from the development trunk do a one-time setup to establish the main GitHub repo as a remote by entering:
git remote add upstream https://github.com/meshery/meshery.git
("meshery" is used as the example repo. Be sure to reference the actual repo you're contributing to e.g. "meshery-linkerd").
<li><h3>Verify the new remote named 'upstream'</h3></li>git remote -v
You'll need to fetch the upstream repo's branches and newest commits to bring them into your repository whenever you wish to update your fork with the latest upstream changes:
git fetch upstream
Now, checkout your master branch and merge it with the master branch of the upstream repo:
git checkout master
git merge upstream/master
If the local master branch has no unique commits, git will simply execute a fast-forward. However, if you've been making modifications to master (which, in the vast majority of circumstances, you shouldn't be - see the next section), you may run into issues. Always keep in mind the changes made upstream when doing so.
Your local master branch is now up to date with everything that has been changed upstream.
<li><h3>Create a Branch (to avoid conflicts)</h3></li>It's essential to create a new branch whenever you start working on a new feature or bugfix. Not only is it a standard git workflow, but it also organises and separates your modifications from the main branch, allowing you to simply submit and manage several pull requests for each task you finish.
Follow the steps below to establish a new branch and begin working on it.
<li><h3>Check out the master branch; from which your new branch will be derived.</h3></li>git checkout master
For continuous integration changes use
ci/your_username/issue#
OR
feature/your_username/name_of_feature
For bugs use
bug/your_username/issue#
OR
bug/your_username/name_of_bug
git branch feature/jdoe/567
git checkout feature/jdoe/567
(NOTE: Use the name of the branch you created instead of 'feature/jdoe/567'.)
Now you may start hacking and make any changes you desire.🚀
<li><h3>Stage the Changes</h3></li>git add [files-changed]
(NOTE: This will stage all the changes you have made.)
git commit -m "MESSAGE"
(NOTE: Instead of 'MESSAGE,' include a commit message so the maintainer can see what you've done.Also make sure to get the DCO signed.)
Before submitting your pull request, you should clean up your branch and make it as easy as possible for the maintainer of the original repository to test, accept, and integrate your work.
If any commits to the upstream master branch have been made during the period you've been working on your changes, you'll need to rebase your development branch so that merging it will be a simple fast-forward with no conflict resolution work.
<li><h3>Fetch upstream master and merge with your repo's master branch</h3></li>git fetch upstream
git checkout master
git merge upstream/master
git checkout feature/jdoe/567
git rebase master
Now, it may be desirable to squash some of your smaller commits down into a small number of larger more cohesive commits. You can do this with an interactive rebase:
<li><h3>Rebase all commits on your development branch</li></h3>git checkout
git rebase -i master
This will open up a text editor where you can specify which commits to squash.
<li><h3>References</h3></li> <a href="https://git-scm.com/docs">Git Reference Docs</a><a href="https://git-scm.com/docs/git-rebase#_interactive_mode">git-rebase / Interactive Mode</a>
<li><h3>Submit the Changes</h3></li> Go to the page for your fork on GitHub, select your development branch, then click the pull request button once you've committed and submitted all of your changes. Simply upload the changes to GitHub if you need to make any changes to your pull request.Your pull request will track and update changes in your development branch automatically.🌸