Lab 2. Git commands.

The main point of the lab two is to write about 2 commands which are new to us. There are two commands which I didn’t use in my first release and about which I want to write here.

First one is git branch. This command will help users to maintain a lot of different branches in one repository. There are two ways of using this command:

  • git branch <name of branch>

If you will use this command like this it will create a new branch with a name you put in. How ever if you will not specify a name and just use this git command like this:

  • git branch

It will show you the list of already created brunches. The one with an asterisk will be the one in which you currently are.

The second command is git grep. This command is very useful for people who want to do a search for some specific strings in a files. There are two ways to use this command. First one is when we specified the file in which we need to find specific string:

  • git grep “some string” <filename>

In this case the command will search for the string we specified in a file which we specified.

In case if we will leave just a command and a string:

  • git grep “some string”

The command will search through all the files in your current directory for this specific line.

Even though we used a lot of commands in during the work on our first release, there are a lot more of them which we need to at lest be aware off. Hope this topic will help anyone who starts working with a git like I do.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s