Auto-push to upstream repository on npm version update

When you publish a new version of your package on npmjs.com with npm version, you can automatically push the version upgrade to your upstream repository as well - thanks to npm scripts!

Add a npm script postversion: git push --follow-tags and you are good to go.

Whenever you made a npm version major, npm version minor, or npm version patch, a new commit will be added to your upstream repository as well, mentioning this version upgrade.

Check this out - it has a freeCodeCamp blog link for a primer on npm scripts!

Create Gitlab repository from terminal

I stumbled upon a rather strange feature yesterday! It turns out it’s possible to push git repositories from the local computer to GitLab.com (I guess it works for self-hosted version of GitLab as well) without actually having to create the repository first on GitLab.com.

I normally create the upstream repository on GitHub or GitLab.com with a README file, clone it and commit changes from there. Or, I create create a first commit, and set upstream logic with git remote add origin git@gitlab.com:arunsathiya/repo.git before pushing using git push -u origin master.

Here, repo is the repository’s name/slug.

But, GitLab.com does not actually require the repository to exist online. Using git remote add origin git@gitlab.com:arunsathiya/repo.git on a repository pushes that to GitLab.com and automatically creats that non-existent repository online.

I reached out to their customer support team here and they confirmed that it’s a feature.

All you need is,

GitLab.com would create that repository for you online, and show this result,

Code references from the document linked earlier.

How I feel about GitHub’s new free plan

Today, GitHub announced that they are offering unlimited free private repositories for all users for free. I would have been very excited about this a few months ago, but I am not at the moment. I jumped ship to GitLab.com and I could say I am happy with it.

GitLab.com seems to offer unlimited free private repositories with no catch like GitHub. GitHub offers free private repositories are limited to 3 collaborations and there are no protected branches available.

Plus, they recently sold to Microsoft and I have been unhappy about that as well.

I am sure GitHub could grow with Microsoft’s leadership and money, but I have been leaning towards using services that aren’t necessarily controlled by the tech giants. I don’t want a monopoly world where giants like Microsoft, Google and Apple rule, but prefer small businesses to grow and offer innovative solutions to challenges. I would be happy to pay for such options as well.

Free open source software should be embraced. I am all for it!

GitLab.com has nice paid tiers as well, but I don’t have a need for them at the moment. But, hopefully when I become a better developer I would be happy to support them financially.

You should try GitLab.com if you haven’t tried so far, or maybe you can consider self-hosting GitLab as well.