GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

Git

Jerry Reeves Jr Information Technology Englisch 17 Karten

Karten in diesem Stapel (17)

  1. 1What is Git?Git is a very famous tool which facilitates source code management in software development.
    We can track changes in computer files (versions) using Git.
    Using git can track the progress of a project over time as well as coordinate work among team developers.
  2. 2What is the difference between Git and GitHub?Git is a version control tool, used to manage the history of changes performed to source code.
    Whereas GitHub is a web application that provides service to host source code, commonly referred to as Git repository.
    GitHub provides all of the distributed version control and source code management (SCM) functionalities of Git, along with a few of its features.
  3. 3What do you understand by Git repository?Git repository refers to a folder/location where all the Git files are stored.
    These files can either be stored on the local repository or the remote repository.
    The local repository is the folder inside your system where you will find one hidden folder named .git
  4. 4What do you mean by initializing a repository in Git? How do we do it?Usually, when a new project is created, developers first initialize the local repository using Git on their system.
    Initializing a repository in Git means creating a directory that will start tracking the changes to your files or source code.
    To do this, we first create a simple empty directory for our application and execute the below command using Git-
    git init
    After the above command, a hidden .git folder will appear in the directory.
  5. 5Can we modify the .git hidden folder under any Git repository?Ideally, the contents of the .git folder are modified by the git command, we are not supposed to tamper with any files manually.
    The .git folder contains all information that is necessary for the project and all information relating to commits, remote repository address, etc.
    It also contains a log that stores the commit history and helps to roll back to the desired version of the code.
  6. 6How to view commit logs in git?Git repository holds all of the commits (snapshots of all your files at a point in time) that have been made.
    We can access the commit history with the below command.
    git log
  7. 7What is the working directory/tree in Git?The project files that we are currently working on are called working trees,or working directory
    We can think of a working tree as a file system where you can view and modify files.
  8. 8What is the staging area in Git?The staging area also called an index, is where commits are prepared.
    The index compares the files in the working tree to the files in the repo.
    When you make a change in the working tree, the index marks the file as modified before it is committed.
  9. 9How to copy the remote repository onto your local machine?We can copy a remote repository onto your local machine using the below command
    git clone ''
    Above command will automatically set up a local master/main branch that tracks the remote master/main branch it was cloned from.
  10. 10How to clone a specific branch using git clone command?To clone lets say feature branch named feature/audit from the GitHub remote repository we can use the below command-
    git clone -b feature/audit --single-branch 'https://@github.com/my-organization/my-project.git'
  11. 11Which command adds a change from the working directory to the staging area.The git add command adds a change in the working directory to the staging area.
    We tell Git that we want to include updates to a particular file in the next commit.
    git add -A
    or
    git add --all
    Above command stages all (new, modified, deleted) files
  12. 12What is the Git command to save your changes to the local repository?The git commit command is used to save your changes to the local repository.
    We need to ensure that we use the git add command to mark the desired changes for inclusion.
    git commit -m "Added first commit"
    In the above command, we specify the message for the commit.
  13. 13What is the use of the git push command?The git push command is used to upload local repository content to a remote repository.
    Using this command we transfer commits from your local repository to a remote repo.
    git push
  14. 14What are untracked files in git status?Untracked files are files that have been created within your repo's working directory but have not yet been added to the repository's tracking index using the `git add command.
  15. 15What is a source code repository?A source-code repository is an archive with the code as well as the hosting facility for these software archives, where you can also have the project’s technical documentation, web pages, snippets, patches, etc.which can be accessed publicly (open-source) or privately.
  16. 16What are the benefits of the source code repository?Using a source code repository has many potential benefits for an organization, including:
    Concurrent Development: Repositories usually allow multiple developers to make edits to different parts of the same program simultaneously.Developers can then merge their changes back into the main program.
    Increased Transparency: Most source code repositories require a developer to check out, edit, and then check back in the part of the program he or she was editing.The repository records which developer made changes and when, resulting in a log of updates made to the program over time.
    Version Control: When developers make enough changes to a program stored in a source code repository, they can designate the updated program as a new “version” of the software.A repository also stores previous versions of a program, a feature that allows companies to restore a previous version if, for example, an update introduces a harmful bug.
  17. 17What are some basic Gitlab commands?1.Git init 2.Git add 3.Git commit 4.Git status 5.Git config 6.Git branch 7.Git checkout 8.Git merge

Informationen

Beschreibung
Git Interview Questions
Erstellt von
Jerry Reeves Jr
Aufrufe
16
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck