Use .gitignore

# Comment can be written like this one

# excluding directory

# Common setting

# Excluding using RegEx
## exclude all files having 'p' and '1' at the end of its name

# Windows image file caches

# Folder config file

# Windows shortcuts

# Windows Recycle Bin used on file shares

# IDE/Editor specific files/directories

# Composer files

# Node modules

Gitignore Minified/Uglified files*

# ignore minified files

Use compiling tools that has config files like





and throw un-compiled files only

* you can throw minified files of third party libraries, what you don't change, and use as they are

Use .editorconfig

# This file is for unifying the coding style for different editors and IDEs

root = true

charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4

indent_style = space
indent_size = 2

end_of_line = crlf
  • .doc, .docx etc.
  • .xls, .xlsx etc.
  • .pdf etc.
  • .jpg, .gif etc.
  • .zip, .rar etc.

Binaries are discouraged

Use markdown/text files

  • .txt
  • .md,.markdown
  • .svg

markdown _cheatsheet_

Empty directory in Git

always untracked, unless there is a file inside

We recommend using a placeholder file inside

so that git can identify the directory as a filled one.

$ touch .gitkeep

A blank .gitkeep file is preferred

One Task per Commit

don't mix up multiple

$ git checkout -b exp-style

$ git add -A
$ git commit -m "Experiment with background image"

Go for a branch if it's experimental

One Task per Commit

don't mix up multiple

$ git checkout -b module/district

$ git add -A
$ git commit -m "Initiate District module"

Go for a branch while dealing with separate module/feature

One Task per Commit

don't mix up multiple

$ git add path/to/district.ext
$ git commit -m "Fix District module with new data"

$ git add path/to/district.ext
$ git commit -m "Fix District module with design issues"

$ git add path/to/district.ext
$ git commit -m "Fixe database connectivity in district module"

Go for a separate commit for each different task

One Task per Commit

don't mix up multiple

$ git add --patch filename.ext

Go for a separate commits, even the task was in same file

Meaningful Commit Message

Commit messages aren’t about the code, they’re about the change itself.

- Logan Johnson (Square Engineering, New York)

Meaningful Commit Message

  • "district fixed"
  • "index changed"
  • "district, division, attendance all are done"
  • "Fix district query with a 3rd party library DIST"
  • "Fix all the links in index file with new repo path"
  • "Fix district module with new data"
  • "Fix division module with new data"
  • "Make Attendance Module"

$ git commit -m "Brief commit message↵
- ↵
- Brief Description what the commit does↵
- ↵
- Issue#12"↵

following angular contributing note

$ git commit -m "single line commit message"↵

Commit Message Convention

Branching Model







Bonus Tip

$ git gc

Run garbageCollection once or twice a week

so the git archive stay compressed and fresh


There's always a chance to do things in better ways...

Thank You

Mayeenul Islam

Front End Designer, WordPress Developer, Wikimedian and Trekker




google "mayeenul islam"

Git Recommendations

By Mayeenul Islam

Git Recommendations

Basic recommendations for Git to implement in any organization/individual collaboration

  • 1,423
Loading comments...

More from Mayeenul Islam