Skip to content

Instantly share code, notes, and snippets.

@akuzemchak
Last active November 16, 2023 08:48
Show Gist options
  • Star 62 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
  • Save akuzemchak/5210425 to your computer and use it in GitHub Desktop.
Save akuzemchak/5210425 to your computer and use it in GitHub Desktop.
New L4 project with clean history
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit
@jahvi
Copy link

jahvi commented Jul 2, 2013

Just a quick note on doing the same now that laravel is stable, since you're cloning the master branch now you won't be able to run git checkout --orphan master because there's already a branch named master so the steps I take now are:

# Initial setup
git clone -o framework https://github.com/laravel/laravel.git project-name
cd project-name

# Rename pulled master branch
git branch -m master laravel

git checkout --orphan master
git commit -m "Initial commit"

# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/master
# Fix merge conflicts if any and commit

I think you can even delete the laravel branch but I'm not sure. Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment