Entries with the tag “git”

These entries have all been tagged with “git”.

Creating an Orphan or Empty Git Branch

Mar 3, 2023 git

Sometimes you may want to make a completely empty git branch in your repo. This is how you can do it.

A Better Alternative to .gitkeep

Jun 28, 2021 git

Since git does not store folders specifically (just path information), if you need an empty folder in your project that can be hard. Especially if that folder needs git to ignore any content inside of it. A community convention to solve this challenge has been the .gitkeep file. This is not part of the spec, combining that file with various .gitignore rules can solve this problem. But, there’s a better way.

Mirror a Git Repository Without Forking

Jun 21, 2021 git

I had a need to mirror a git repository on Github, but I wasn’t allowed to fork the repository. Luckily, there is a mirror option built into git.

Host PHPUnit Code Coverage Image in Your Repo

Dec 15, 2020 git php testing

I’m a sucker for those little badges at the top of the README files in Github repos. I know you can get them from external services, but could I host my own? Let’s find out.

Musings on Github

May 28, 2018 git misc-web

Github is one of the most useful tools I have in my arsenal. With over 100 repositories (some of which are private), it’s the best $7/mo I spend. However, there are a couple things about Github you might not know.

Export Git Project

Jun 21, 2016 git phpstorm

I manage any WordPress plugins I create using git. In order to create a distribution of those, I need to zip up the source code and use that to upload to the marketplace (or directly upload). This was easy with SVN - I just used an svn export command and there we go.

Sync BitBucket and GitHub

Jun 6, 2016 git

At my current job, we keep both a private copy of the code in BitBucket (where all of our code resides), and make a few repos public on GitHub. (Wish I didn’t have to do that, but really, GitHub is the premier place to get your code it seems these days.) So, I decided to come up with a solution to keep both repos up to date as I do my development.

Restrict your .git directory on live site

Jun 15, 2010 git security

Do you use Git to manage your repository? If so, do you use it to check out code onto the server as well? If you do, you really should restrict access to your .git directory if it’s in your public root. (If you’re using things like Zend Framework, chances are your root directory is not your public directory, so you have less to worry about.)