See Git-Branching-Rebasing for the built-in way. Here's how to do it manually:
Preconditions: On a new branch, forked off of develop and now ready to merge back into develop.
-
Fetch updates from remote
git fetch origin develop
-
Ensure that current branch is the one I intend it to be
git checkout my-feature-branch-name
-
Create a backup branch in case all goes wrong
git branch backup-of-my-feature-branch-name
-
Merge develop branch into my branch
git merge origin/develop
-
Deal with any merge conflicts, save the affected files
-
Soft reset to unstage all modified files
git reset origin/develop
-
Add the files that I want included in this commit
git add --all
orgit add file1 file2
-
One single commit message that will represent the entire group of changes
git commit -m "one single message"
-
Push the changes to my remote fork. Use
--force
flag if commits have been pushed to this remote branch since branching off of develop. The syntax here is<server> <local branch>:<remote branch on server>
git push --force origin my-feature-branch-name:my-feature-branch-name
-
Create a pull request on repository server (GitHub, VSTS, etc.)