19
loading...
This website collects cookies to deliver better user experience
Git
and a few usages, practices that you should avoid making your development experience a better one.Git
is an open-source version control system(VCS) that helps all project contributors to keep their project artifacts(folder, files, source code, and many more) in sync. It provides a workflow that is easy to understand, learn, and use in practice. If you are a beginner to Git or have any difficulties with its usages, here is an in-depth, hands-on video tutorial for you. Please have a look.Git
is a highly flexible tool. When you know to handle Git Commands, you feel superior about managing things. At the same time, if you are unsure about specific usages or mismanaging them, you may end up losing changes, making yourself & the team frustrated. Here are ten usages we should stop or avoid.master
branch must contain the most stable version of your source code and other project artifacts. It is most likely that you will build your end product from the master or a release branch. Committing and pushing to these branches directly have a higher risk of corrupting changes, introducing bugs, hours of extra work."With great power comes great responsibility"— the Peter Parker principle.
.gitignore
file at the root of the project folder and mention file patterns(like .env*) to ignore from staging.Technically, you can store anything in a Git repository as long as it doesn't bother and cost someone. The cost is not always the money. It is about time too. It would be a massive waste of time for someone to clone a repository because we have stored a few gigabytes of video in it.
.gitignore
is a particular file where you can mention file name patterns to ignore specific files from the staging. Thus there is no chance of any accidental commit and push of the ignored files. It is a savior. If you are a web developer, you may not want to push the node_modules
folder to your remote repository. .gitignore
file with file name patterns and keep it at the root of the project folder.reset
may not be the only solution.end-of-the-day push
. Many small logical commits are much better than a larger ones. As we know, for each commit we make, git writes it to the history with a commit id and user-provided message. Hence it is a good practice to break your commits into small logical chunks.merge conflicts
.