Kannan Sudhakaran has Published 14 Articles

How to add collaborators to a repository in GitHub?

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 09:01:54

5K+ Views

Even if you have a public repository in GitHub, not everyone has the permission to push code into your repository. Other users have a read-only access and cannot modify the repository. In order to allow other individuals to make changes to your repository, you need to invite them to collaborate ... Read More

How to create a GitHub repository

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:56:29

2K+ Views

A GitHub account is a pre-requisite for creating a GitHub repository. Follow the below steps after registering with GitHub.Step 1 − Login to the GitHub account. Once you login to your account you will see a ‘+’ button on the right. Click on the button and select "New repository" option ... Read More

How to clone a GitHub repository?

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:48:47

2K+ Views

Cloning a repository involves downloading a copy of the source code from source control. In other words, cloning is creating a copy of an existing repository. Consider an example where multiple users are working on a project. This feature can be used by the users to create a development copy.If ... Read More

Explain rebasing in Git

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:34:57

1K+ Views

Rebasing alters a sequence of commits. It moves or relocates a sequence of commits from current branch to the target branch. By default, the commits from the current branch that are not already on the other branch are rebased. Rebasing technique allows us to keep a linear history.Let us understand ... Read More

How to undo a faulty merge with reset command in Git?

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:22:06

2K+ Views

Let us say we performed a merge commit and later found out that the code is not compiling or our application is not working. This happens if we make mistakes while merging. In situations like these we need to undo the merge using either −reset command; ORrevert commandThe git reset ... Read More

Explain soft reset with an example in Git

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:18:54

888 Views

Soft reset will move the HEAD pointer to the commit specified. This will not reset the staging area or the working directory.ExampleThe diagram shows a file named File1.txt within the git repository. A, B, C and D represent lines that are added to the file. The diagram indicates that a ... Read More

Explain how reset command works in Git

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:11:58

985 Views

The commit command moves the HEAD of a branch implicitly. The below diagram shows that initially HEAD was pointing to commit c1. After each commit operation the HEAD pointer moves ahead to the new commit. We can perform a reset using the HEAD pointer or commit hash.The git reset command ... Read More

How to abort a merge conflict in Git?

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:03:28

2K+ Views

When doing a merge, you may run into one or more conflicts. Now what if we are not quite ready to handle this conflict yet. Perhaps you have several conflicts and you don't have enough time to spend on resolving these conflicts. In situations like this we can easily go ... Read More

How to view merged and unmerged branches in Git?

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 07:48:08

7K+ Views

When we have multiple branches in a git repository, we would need to bring the changes from all the branches to the main line of work that is the master branch. So, if we are currently in master branch and need to see which branches need to be merged, we ... Read More

How to disable fast forward merges? What are its pros and cons in Git?

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 07:46:06

2K+ Views

Fast forward merges can be disabled −At the time of mergingFor the entire repositoryFor all repositories.Disabling fast forward merges has both pros and cons.When we disable fast forward merge, git will perform a merge commit to merge the changes from both the branches. The drawback of merge commit is that ... Read More

Advertisements