- (Give your branch a simple, informative name.)
- Git Reference Docs
- 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.
( You will see this on Top Right of Github Repository !)
( 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").
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.
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.
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.🚀
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.
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:
git checkout
git rebase -i master
This will open up a text editor where you can specify which commits to squash.
git-rebase / Interactive Mode
Your pull request will track and update changes in your development branch automatically.🌸