How to not use git!

Ruhul Amin
Nerd For Tech
Published in
3 min readMar 30, 2022

--

we, every developer use git every day. are we really using git in the proper way? today I will discuss how not to use git with you. so let's start!!

1. Do not commit directly to the master, dev, release branches.

It is a bad practice, If we think ideally we should not do direct commit in the master branch. The Master branch should contain a completely tested and deployable version of code which means we will merge the developed branch with the master branch when we are ready to release our changes. we can use git-flow for this.

2. Do not commit the application secrets (.env/.evn* files).

.env files are amazing! right? it contains the database password, API key, Jwt secret, and many more. but we should not commit that sensitive information to git directly. we can use .gitignore for .env file

3. Do not use Git as file storage, stop storing large files.

we should not push multiple large files on git. git has a limit of storage. for storing files we can use s3 or any other service.

4. Do not work on multiple issues in a single branch.

for solving issues, we can create a new branch. Stop fixing multiple issues in a single git branch. If you find an issue, log it and create a new branch for it. No matter how minor the issue is! create a new branch for it. Because as your project increases in complexity, so is the need to keep issues logged and organized.

5. Do not ignore .gitignore.

try to use .gitignore to protect your private information of the project for example DB password, token, API key, and many more.

6. Do not force push.

git push -f ? (no! Please Don't!! Bad idea!!!😥😥 )

suppose one of your co-workers working with the same branch name. now you are going to push with a new branch(same branch name) but he already pushes code. but this time by your push his code will be destroyed.

and some mentionable tips are
# Do not modify or delete the commit history.
# Do not reset a branch without committing changes.
#Do not make bulky commits.
#Do not amend a commit in the remote casually.

Thanks for reading my post. If you have any questions related to this post or this topic, do raise your questions in Counsily, where you can talk to verified experts directly and get answers. Counsily is a club for high intellect individuals to ask their questions & get personalized help from verified consultants. ask.counsily.com

Say Hello on Linkedln,fiverr

--

--