![]() |
Git Tips and Tricks
I have tried introducing people to Git VCS, both personally and through by articles at G4E, I have written 2 articles, Introduction to Git VCS & Git VCS - Cloning & Workflow, in this article
Get A List Of Files Modified Between Two CommitsAt times working on a feature or an enhancement of an already live project we might forget some files which we might have worked on, or we might need to make the feature live, and so we need to know the files to make live. With this command you can get the list of file between two commit. Code:
Example: Code:
Ignoring Some FilesThere are some files which we might not want to use version control on, like logs, temporary files, binary files like images etc. But they always show up on git status command. For this purpose git reads a special file .gitignore where you can specify the files/directories, by names and/or wildcards the items you want to be ignored by Git. See the example below. Code:
As you can see from the example, the untracked files ending with ~ are no more reported by Git. Creating Git AliasesLike all command-line statements we might also like to shorten frequently used Git command like commit branch etc. You can set them up easily, all you have to do is to edit the .gitconfig file and add aliases under the [alias] section, checkout the example below. Code:
Now, you can issue commands like this, Code:
|
| All times are GMT +5.5. The time now is 19:34. |