




Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Prepare-se para as provas
Estude fácil! Tem muito documento disponível na Docsity
Prepare-se para as provas com trabalhos de outros alunos como você, aqui na Docsity
Os melhores documentos à venda: Trabalhos de alunos formados
Prepare-se com as videoaulas e exercícios resolvidos criados a partir da grade da sua Universidade
Responda perguntas de provas passadas e avalie sua preparação.
Ganhe pontos para baixar
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Comunidade
Peça ajuda à comunidade e tire suas dúvidas relacionadas ao estudo
Descubra as melhores universidades em seu país de acordo com os usuários da Docsity
Guias grátis
Baixe gratuitamente nossos guias de estudo, métodos para diminuir a ansiedade, dicas de TCC preparadas pelos professores da Docsity
A comprehensive overview of git, a distributed version control system and source code management (scm) system. It covers various git concepts, commands, and best practices, making it a valuable resource for developers and it professionals. The document delves into the differences between git and svn, the structure of a git repository, creating and managing local and remote repositories, branching and merging, conflict resolution, and more. It also explores advanced git features like stashing, rebasing, and reverting commits. This document can serve as a reference guide for those preparing for git-related interviews or seeking to deepen their understanding of this powerful version control tool.
Tipologia: Esquemas
1 / 8
Esta página não é visível na pré-visualização
Não perca as partes importantes!
1. What is GIT? GIT is a distributed version control system and source code management (SCM) system with an emphasis to handle small and large projects with speed and efficiency. 2. What is Distributed Control System? We work in our local machine and later we transfer the code to Centralized repository (GitHub). We don’t need to connect to centralized repository to work. 3. What is GIT version control? - GIT version control allows you to track the history of a collection of files (code files). - It supports creating different versions of file collection. Each version captures a snapshot of the files at a certain point of time and You can revert the collection of files using the snapshot. (You can develop the code in different versions of java. and you can merge in Git) - VCS allows you to switch between these versions. These versions are stored in a specific place, typically called as repository. (You can switch between different versions of java in between development process) 4. What is difference between SVN and Git? SVN GIT SVN is centralized repository, that means directly we involved in the centralized repository. Git is distributed repository, first we are working in our laptop after that we are transferring the code from our laptop to centralized repository. Git have three phases the phases are work space, staging/index, local repo. We working on SVN means if we are facing any networking issue we can’t work on SVN because of we are directly involve into the centralized repository. In git we are doing in local systems only so no need to internet connection, when pushing the code from our system to centralized repository at that time we need network connection. Without network also, we can do some work. Developed directly interact with the centralized repository. Developers not directly interact with the Centralized repository. 5. What is a repository in GIT? A Git repository contains the history of a files.
6. How can you create a local repository in Git? By using # git init command create a local repository. 7. What is ‘bare repository’ in GIT? A bare repository in Git just contains the version control information and no working files (no tree) and it doesn’t contain the special .git sub-directory. 8. How to configure GitHub repository locally? # git config --global user.name "user_name" # git config --global user.email "user_email" 9. How to Create Alias to git commands # git config --global alias.lo "log --oneline" -----> To create an Alias to Command # git config --global --unset alias.lo -----> To Remove an Alias # git config --global --unset user.name -----> to remove username 10. What is the git clone? To download an existing repository from Centralized (Github) to local system. # git clone
28. How to see the branch list? # git branch 29. How to see the remote branch list? # git branch - r Or # git remote show origin 30. How to see the local and remote branch list? # git branch - a 31. How to delete a branch? # git branch - d <branch_name> Or # git branch - D <branch_name> 32. How to delete a Remote Branch? # git push origin - d <branch_name> 33. How to see the difference between 2 branches # git diff
39. How do you pull a file from particular remote branch? # git pull origin <branch_name> 40. How do you download a remote branch to local without merge? # git fetch origin <branch_name> # git checkout <downloaded_branchname> 41. What is git Fetch? git fetch is only downloads new data from a remote repository, but it doesn’t integrate any of the downloaded data into your working files. All it does is provide a view of this data. # git fetch <branch_name> # git fetch origin <branch_name> 42. What is difference between git clone & git pull? - If you want to download whole existing repository than use Git Clone. - If you have already repository but you want to take new updates of existing repository than use git pull command. 43. What is git merge? Git merge is used to combine two branches.
Note: you should be in target branch. Then run the command 44. What is git conflict? What is the scenario you will get git conflict error? For example, if you and another person both edited the same file on the same lines in different branches of the same Git repository, you'll get a merge conflict error when you try to merge these branches. You must resolve this merge conflict with a new commit before you can merge these branches. 45. How do you resolve merge conflict? Will inform the developers regarding this merge conflict. They will change the code and inform us. edit the files to fix the conflicting changes and then add & commit. 46. How do you skip from merge conflict? #git merge --abort 47. What is the function of ‘git rm’? To remove the file from the work area/staging area and also from your disk ‘git rm’ is used. You can revert a deleted file. if it is deleted using ‘git rm’. If you deleted a file ‘rm’ command then you can’t get it.
52. What is git stash? Stashing takes the Temporary stored state of your working directory. # git stash save "
59. Why GIT better than Subversion (SVN)? Git is an opensource version control system; it will allow you to run ‘version' of a project. Multiple developers can check out, and upload changes and each change can then be attributed to a specific developer. 60. How to Lock a branch? why we need to lock a branch? - On GitHub, navigate to the main page of the repository. - Under your repository name, click Settings. - In the left menu, click Branches. - Select the branch you want to mark protected using the drop-down menu. - Select Protect this branch. 61. How to delete Repository in GitHub? - On GitHub, navigate to the main page of the repository. - Under your repository name, click Settings. - Scroll to the bottom of the page and you will find Delete this repository button - When you click on that button, another pop up will appear, here you need to type in the name of your repository name and click on the button bellow which says: I understand the consequences, delete the repository. 62. how to give an access to a specific person to repository? You can invite users to become collaborators to your personal repository. - Under your repository name, click Settings. - In the left sidebar, click Collaborators. - Under "Collaborators", start typing the collaborator's username. - Select the collaborator's username from the drop-down menu. - Click Add collaborator. - The user will receive an email inviting them to the repository. Once they accept your invitation, they will have collaborator access to your repository.