Skip to content

Laravel Git Tricks

By Jasper Frumau

There are many git commands you need to run your Laravel projects well. Here are Laravel Git Tricks that I am sure you cannot live without

List all branches of your project

If you would like to see all the git branches you have in your Laravel Project you can do a:

git ls-remote --heads

To exclude a directory from git that is currently in see post “Remove Node Modules from Git Repository”

Switch to a branch to test locally

If you would like to work on another git branch, perhaps a test branch you can do this with checkout:

git checkout branch_name

I expect you had no untracked files or missing commits. If you did commit them first doing a:

git add -A && git commit -a -m "message"

Check Current Branch in use

If you need to later on know the current branch in use you can run

git rev-parse --abbrev-ref HEAD

Merge Test Branch

To merge a staging or test branch with your master branch do a

git checkout master
git merge staging

 

 

Comments are closed for this post.