Skip to content

Instantly share code, notes, and snippets.

@mre
Created September 27, 2017 11:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save mre/64672c481f8f1232d468e3e7169f4f77 to your computer and use it in GitHub Desktop.
Save mre/64672c481f8f1232d468e3e7169f4f77 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