Kannan Sudhakaran has Published 20 Articles

How to add collaborators to a repository in GitHub?

Kannan Sudhakaran

Kannan Sudhakaran

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

4K+ 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

1K+ 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

Explain Git collaboration workflow

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:51:33

234 Views

Version control systems are of two types - centralized and distributed. In a centralized system there will be one single repository that is shared by all team members. Problem with this system is that if the central repo goes offline then all people dependent on the central repo will be ... 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 cherry picking in Git

Kannan Sudhakaran

Kannan Sudhakaran

Updated on 30-Apr-2021 08:43:27

299 Views

Cherry picking is a way to choose specific commits from one branch and apply them to another branch. This is useful when you want to select specific changes from a pull request.git cherry-pick {commit_hash}The above command will cherry pick the commit associated with the specified commit hash to the current ... Read More

Explain rebasing in Git

Kannan Sudhakaran

Kannan Sudhakaran

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

797 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

Explain squash merging in Git

Kannan Sudhakaran

Kannan Sudhakaran

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

1K+ Views

Imagine if your feature branch has large number of commits- E.g. 100s commits. Rather than merging all commits individually from feature to master, there is an option to add up all commits into a single commit. This is called a squash commit because it "squashes" all the individual commits into ... Read More

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

Kannan Sudhakaran

Kannan Sudhakaran

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

9K+ Views

Let us say we performed a merge commit, shared this 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 the git revert command.Consider ... 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

665 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

Advertisements