Skip to content

Instantly share code, notes, and snippets.

@bartoll
Created January 7, 2021 22:19
Show Gist options
  • Save bartoll/89d918f9a83de2a6adc15a98c7f80951 to your computer and use it in GitHub Desktop.
Save bartoll/89d918f9a83de2a6adc15a98c7f80951 to your computer and use it in GitHub Desktop.
Project's contribution based on changes made in composer vendor folder
# Go into the directory of the vendor package that you changed
cd vendor/<owner>/<package>
# Create a new git repository
git init
# Create a new 'main' branch
git checkout -b main
# Commit all your changes
git add .
git commit -m "Your comment here"
# Add the git remote, which contains the source code your fork from original package project
git remote add origin git@github.com:<repo>.git
# Create the new branch 'develop' based on remote git
git fetch origin develop:develop
# List all tags and find one that corresponds to version of installed vendor package
git tag -l
# Create the new branch 'issue-xxx' based on specified tag
git checkout -b issue-xxx tags/YYY
# Execute reverse git diff and apply all your changes
git diff -R main | git apply --whitespace=fix
# Commit all your changes again
git add .
git commit -m "Your comment here"
# Push your branch 'issue-xxx' to remote git
git push -u origin issue-xxx
# Now you can create a Pull Request if you want
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment