Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vchavkov82/a4127e4b18876cbd9a9841efe59311a2 to your computer and use it in GitHub Desktop.
Save vchavkov82/a4127e4b18876cbd9a9841efe59311a2 to your computer and use it in GitHub Desktop.
Make a change in a composer vendor folder and push to branch
# Go into the directory of the vendor package that you changed
cd vendor/<owner>/<package>
# Create a new git repository (composer does not check out the full git repo by default. Only a sparse copy)
git init
# Create a new branch for your local changes
git checkout -b branchname
# Commit changes
git add .
git commit -m "Commit message"
# Add the git remote, which contains the source code
git remote add origin ssh://git@<repo>.git
# Pull changes from remote (sync)
git pull origin master --allow-unrelated-histories
# Fix merge any conflicts
# then push your branch
git push --set-upstream origin branchname
# You can now 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