Skip to main content

Git Commands

There are many commands on git that new developers do not know of. These commands can make working in open source projects, or group projects easier to understand. Of all these commands, I will be going through two that most new developers do not know of.

Log

While working in large groups, there are many commits that you or others may have done within a repository. Using 'log,' you can view the history of all the changes made.

Basic command:   git log 

With this basic command, you can view the commit id, author of the commit, date of the revision, and the details the user wrote.  

  git log --follow filename   

This command allows you to follow the commit history of a single file. It is useful for working in big groups as you can follow a file that you contributed to, instead of viewing the whole repository. Simply replace 'filename' with the directory of the file you want to view.

  git log -number 
  git log -number --follow filename 

This command limits the number of commit history that will be displayed, to the number provided. For example, git log -5 will show the 5 most recent commits. You can also use this command with the previous 'follow' command, to limit the commits shown to a specific file. 

  git log --since="date"  
  git log --since="date" -- filename  

This command allows you to view all the commits done within a specific time frame. 

Tag

When working in projects, there are many times you have to tag specific points (example: Release points).

Basic command:   git tag  

This command lists all of the tags in that repository. 

  git tag -a  

This command is used to create a tag.

  git tag -l "tag"  

This command allows you to search for specific tags. For example, 
  git tag -l "v0.0.*"   will search for all the tags that start with v0.0. 

  git tag -d tag  

This command deletes a specific tag.

Comments

Popular posts from this blog

Release 0.1

The past few weeks I have been looking at the differences between declaring variables for JavaScript. Var, Const, Let are the variable declarations that are widely used, each one having a specific purpose. New developers mostly use 'var,' as it is the first technique taught. However, 'var' declarations is no longer widely used by JavaScript developers. The modern practice of variable declarations is with ' const ' and ' let '. Before starting anything, I had to first understand the difference between the three: Const  declarations means the values cannot be changed/reassigned.  Let declarations should be used when declaring local variables in a block scope.  Var declarations hold the weakest signal which can be used outside of a block, and can be reassigned. For Release 0.1 , we were asked to look into a library called 'filer.js.' The task was to go through one of the test files, and change the old-fashioned 'var' declarati...

Lab 3: Potential Projects

In this lab, I will be going through three potential open source projects I would like to contribute to. 1: iD Repository : https://github.com/openstreetmap/iD iD is an easy to use OpenStreetMap editor, which uses Javascript. It supports all of the current modern browsers, and the intention is to do the basic tasks without breaking other people's data. I chose this open source project, as I was always interested in figuring out how to play around with Maps. I am going to go through the issues to see if there is anything I am capable enough to fix, or find issues on my own when going through the code. What I would need to learn is Javascript, how to support all browsers, and how to properly contribute worthwhile issues to the project. 2. Teammates Repository : https://github.com/TEAMMATES/teammates Teammates is a cloud-based open source project that provides users to manage peer evaluations and other feedback for students. It is used by both the educator and the stud...