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.2 - Lab 4

Issue: https://github.com/RabanserD/rabanserd.github.io/issues/75 This week I managed to find an issue that required a pull request template. The required technology for this issue was github and '.md' for the documentation.

Lab 8

This lab is the final lab regarding this course, so I chose two issues to work on for the span of the last two Releases (0.3, 0.4). The first issue I found was an RPG game that needed to implement global stats that track the players total player deaths, monster kills by type and top stats. The language used is JavaScript Issue 1 (0.3):  https://github.com/ASteinheiser/react-rpg.com/issues/14 The second issue I found was for a rock-paper-scissors game, that needs to implement a Refresh button that resets all the win/loss/ties back to 0. Issue 2 (0.4):  https://github.com/golemheavy/RPS-Multiplayer/issues/14

Release 0.2 - Lab 5

Issue: https://github.com/novisadjs/novisadjs.github.io/issues/1 This week I managed to find an issue that required an icon that needs to be implemented into the webpage, with a hyperlink. The person that created the issue provided an icon already, so all I had to do is implement it into the .html file. I managed to fix this issue, and got the pull request merged into the code.