Log in
updated 11:29 AM UTC, May 4, 2016

How to create, delete and push tags in Git

As you all know tags are used in Git to handle the releases. It helps in identifying commit points which are helpful.

This article explains the creation of tags with common options and deleting the tags with common options.

Before creating or deleting tags - make sure your tag history on your local is up to date with the remote branch.

use following to delete any unncecessary tags in your local repo:

git tag -l | xargs git tag -d
git fetch

To create a new tag , just type in the following command

git tag -a -m "Your message for the tag" TagVersion

example: git tag -a -m "Release candidate - v2" v2

 

To delete the tag

git tag -d TagVersion

example , to delete the version v2: git tag -d v2

 

Once the tag is created , you have to push it to the server. Use the following command for it:

git push --tags

 

if you want to delete a tag on the remote branch , use the following:

first delete the tag on the local repo:
git tag -d v2
and then type:
git push origin :refs/tags/v2

 

 

 

 

 

 

Add a comment (0)

  • Written by Madhu V Rao
  • Category: General Topics
  • Hits: 1501

how to count number of occurrences of a word in Ubuntu

We come across several situations where we need to know the number of occurrences of a word in a file.

for example: when you want to know no of rows in a JSON file.

Here is a command which does exactly what we need, it combines grep with wc.

grep -o "YourString" YourFileToSeachTheString.Ext | wc -w

 

Add a comment (0)

  • Written by Madhu V Rao
  • Category: General Topics
  • Hits: 2114

How to tar(Zip)/untar(Unzip) in Ubuntu Linux

Its bit confusing and time consuming if you are not frequently doing tar and untar.

Here is an example to tar and untar using Linux tar command.

 

Syntax:
To Tar:

tar –cvzf your_tarfilename folder_to_tar

Untar:

tar –xvzf your_tarfilename

Example:
tar –cvzf Yourfilename.tar.gz FOLDER_TO_TAR

This will zip (tar) the FOLDER_TO_TAR folder with the name Yourfilename.tar.gz

tar –xvzf Yourfilename.tar.gz

This will unzip (untar) the file as FOLDER_TO_TAR folder.

 

 

Add a comment (0)

  • Written by Madhu V Rao
  • Category: General Topics
  • Hits: 3263

How to install Java/JDK 7 on Ubuntu 12.10 or 13.04

Use the below command to install Jre and JDK on Ubuntu 12.10 or 13.04 :

First, Install JRE:

sudo apt-get install openjdk-7-jre

Now, Install JDK:

sudo apt-get install openjdk-7-jdk

Advantage of installing this way is all the path variables are already updated.

Now type in command to test if java/javac is installed:

try these commands:

java -version

You should get output something like this:

java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-1ubuntu1)
OpenJDK Client VM (build 23.7-b01, mixed mode, sharing)

That's it.

Add a comment (0)

  • Written by Madhu V Rao
  • Category: General Topics
  • Hits: 3396

How to know your Ubuntu version from the terminal

Developers often use uname -a to get the version of operating system.

Though 'uname -a' gives the system information it doesnt give the details about the Ubuntu version.

just type in command:

lsb_release -a

output looks like this:

No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 13.04
Release:    13.04
Codename:    raring

As you can see in the output, it clearly provides the Ubuntu version in the description field.

Add a comment (0)

  • Written by Madhu V Rao
  • Category: General Topics
  • Hits: 3894

How to uncompress .tar.gz files in Ubuntu

In Ubuntu compression is usually done using tar and gzip the files.

We usually come across files like : directories.tar.gz on ubuntu.

Justtype in command to uncompress and untar in a single line using:

gunzip < directories.tar.gz | tar xvf -

That will unzip and untar at the same time.

Add a comment (0)

  • Written by Madhu V Rao
  • Category: General Topics
  • Hits: 2264

How to set Ubuntu Environment variables without logging out

Its very easy to set environment variable in Ubuntu.

Just edit the file /etc/environment and add your env variable.

Once done save and close it. Its not done yet .

Just source the file /etc/environment to make it work immediately without needing logout and relogin.
 Type in command:

source /etc/environment

That's it, you can now test the environment variable by typing in command:

echo $YOUR_VARIABLE

Add a comment (0)

  • Written by Madhu V Rao
  • Category: General Topics
  • Hits: 2321
Follow Us on Twitter
Find Us on Facebook
Follow Us on Google
Follow Us on Pinterest