• LOGIN
  • No products in the cart.

GitLab Interview Questions

What Is Gitlab?

GitLab is a web tool to assist with visualizing and managing your git projects. GitLab includes Git repository management, code reviews, issue tracking, wikis, and more. Collaborate with your team using issues, milestones, and line-by-line code review or view activity streams of projects or the people you work with.

Git and GitLab are here to help with managing projects, merging development between different people, with different time zones and giving Sealed Air the ability to manage all of its source code in 1 location.

What are the minimum systems Requirements?

  • GitLab Control requires at least iOS 8.1 on the iPhone, iPod Touch, iPad and iPad Mini.
  • It currently supports GitLab server version 9.x and higher, but it is highly optimized for GitLab 10.x.
  • Please note that some of the features may not be available or not work at all on versions prior to 9.0.

Where are my Git Data Stored? How secure is it?

GitLab Control stores your data both online (on your host) and locally. We use the device keychain to store your credentials and an encrypted database to store all the others data. Every message transferred is encrypted with TLS/SSL only when the appropriate option is enabled both on the app and on your GitLab instance.

How do you revert a commit that had already been pushed and made public?

One or more commits can be reverted with the use of git revert. This command, in essence, creates a new commit with patches that cancel out the changes introduced in specific commits. In case the commit that needs to be reverted has already been published or changing the repository history is not an option, git revert can be used to revert commits. Running the following command will revert the last two commits:

git revert HEAD~2..HEAD

Alternatively, one can always checkout the state of a particular commit from the past, and commit it anew.

Is Gitlab The Only Git Repository That I Can Use At Sealed Air?

Whilst there is nothing stopping you running Git only on your local machine to track changes, you will really start to see benefits by using GitLab and getting others involved in your projects. It is built for sharing and working together on code and text.

When Should I Consider Gitlab?

Version control software, like Git, allows you to have “versions” of a project, which show the changes that were made to code, or text files, over time, and allows you to backtrack if necessary and undo those changes or merge your code with others, line by line.

Should I Be Concerned With Confidential Or Proprietary Solutions In Gitlab?

GitLab is ideal at storing source code for projects; however, confidential information such as passwords and credentials should not be stored in git. With regards to hosting our code, there should be no issue with the hosting of code that is either open license (MIT, GPL, and BSD), we have created or licensed for us to use, however, code that has a license for limited use should be handled carefully. If you are not sure, please contact Risk Management or Legal teams.

What Is The Cost Per User Or Project?

GitLab is an Open Source software application under MIT license running on our private and secure instance. There is no cost to add users to GitLab.

What Happens When Active Gitlab Users Are Terminated?

We have implemented Single Sign-On (SSO) for GitLab. This means that terminated users will not be able to access GitLab.

How do you squash last N commits into a single commit?

Squashing multiple commits into a single commit will overwrite history, and should be done with caution. However, this is useful when working in feature branches. To squash the last N commits of the current branch, run the following command (with {N} replaced with the number of commits that you want to squash):

git rebase -i HEAD~{N}                

Upon running this command, an editor will open with a list of these N commit messages, one per line. Each of these lines will begin with the word “pick”. Replacing “pick” with “squash” or “s” will tell Git to combine the commit with the commit before it. To combine all N commits into one, set every commit in the list to be squash except the first one. Upon exiting the editor, and if no conflict arises, git rebase will allow you to create a new commit message for the new combined commit.

How do you setup a script to run every time a repository receives new commits through push?

To configure a script to run every time a repository receives new commits through push, one needs to define either a pre-receive, update, or a post-receive hook depending on when exactly the script needs to be triggered.

Pre-receive hook in the destination repository is invoked when commits are pushed to it. Any script bound to this hook will be executed before any references are updated. This is a useful hook to run scripts that help enforce development policies.

Update hook works in a similar manner to pre-receive hook, and is also triggered before any updates are actually made. However, the update hook is called once for every commit that has been pushed to the destination repository.

Finally, post-receive hook in the repository is invoked after the updates have been accepted into the destination repository. This is an ideal place to configure simple deployment scripts, invoke some continuous integration systems, dispatch notification emails to repository maintainers, etc.

Hooks are local to every Git repository and are not versioned. Scripts can either be created within the hooks directory inside the “.git” directory, or they can be created elsewhere and links to those scripts can be placed within the directory.

What is Git Bisect? How can you use it to determine the source of a (regression) bug?

Git provides a rather efficient mechanism to find bad commits. Instead of making the user try out every single commit to find out the first one that introduced some particular issue into the code, git bisect allows the user to perform a sort of binary search on the entire history of a repository.

By issuing the command git bisect start, the repository enters bisect mode. After this, all you have to do is identify a bad and a good commit:

git bisect bad # marks the current version as bad

git bisect good {hash or tag} # marks the given hash or tag as good, ideally of some earlier commit

Once this is done, Git will then have a range of commits that it needs to explore. At every step, it will checkout a certain commit from this range, and require you to identify it as good or bad. After which the range will be effectively halved, and the whole search will require a lot less number of steps than the actual number of commits involved in the range. Once the first bad commit has been found, or the bisect mode needs to be ended, the following command can be used to exit the mode and reset the bisection state:

May 29, 2020
GoLogica Technologies Private Limited  © 2019. All rights reserved.