Git: Systemas de Control de Version
24 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Qual es le differentia principal inter un Systema de Control de Version Local e un Systema de Control de Version Distribuite?

  • Le systemas local guarda le cambios como un serie de differentias, durante que le systemas distribuite prende snapshots del file systema.
  • Le systemas local solmente permitte un usator, durante que le systemas distribuite permitte multe usatores.
  • Le systemas distribuite have un repositorio central, durante que le systemas local non lo have.
  • Le systemas distribuite permitte a cata usator haber un historia complete del projecto localmente, durante que le systemas local non lo face. (correct)

Qual commando de Git es usate pro crear un nove repositorio in un directorio existente?

  • `git clone`
  • `git commit`
  • `git init` (correct)
  • `git add`

Qual es le function del 'staging area' in Git?

  • Illo es le area ubi le versiones ancian del files es conservate.
  • Illo es le area ubi le cambios es automaticamente commitate al repositorio.
  • Illo es le area ubi le cambios es temporarimente conservate ante esser commitate. (correct)
  • Illo es le area ubi le repositorio distante es conservate.

Qual commando es usate pro registrar le cambios in le 'staging area' al repositorio local in Git?

<p><code>git commit</code> (A)</p> Signup and view all the answers

Qual commando es usate pro vider le stato del directorio de labor e le area de preparation?

<p><code>git status</code> (A)</p> Signup and view all the answers

Qual commando es usate pro discargar cambios desde un repositorio distante sin fusionar los in tu branca de labor local?

<p><code>git fetch</code> (A)</p> Signup and view all the answers

Qual commando es usate pro annullar cambios in un file specific in le directorio de labor retro al version del ultime commit?

<p><code>git checkout -- &lt;file&gt;</code> (C)</p> Signup and view all the answers

Qual option del command git reset move le pointator HEAD al commit specificate sin modificar le area de preparation o le directorio de labor?

<p><code>--soft</code> (B)</p> Signup and view all the answers

Qual command es usate pro registrar un remote repository in Git?

<p><code>git remote add [nomine] [url]</code> (D)</p> Signup and view all the answers

Qual function executa le command git push [nomine_remote_repository] [nomine_ramo]?

<p>Il incarga cambiamentos del ramo local al remote repository. (D)</p> Signup and view all the answers

Qual es le function del command git fetch [remote]?

<p>Il recupera tote le ramos del remote repository. (D)</p> Signup and view all the answers

Qual function executa le command git pull sin attributos specificate?

<p>Il actualisa e committa tu ramo local con le cambiamentos del remote repository e reimplacia le directorio .git in le ramo. (D)</p> Signup and view all the answers

Qual es le differentia fundamental inter git fetch e git pull?

<p><code>git fetch</code> recupera cambiamentos sin fusionar los, durante que <code>git pull</code> recupera e fusiona. (D)</p> Signup and view all the answers

Quando es appropriate usar le command git pull --rebase?

<p>Quando tu vole actualisar tu ramo local sed mantener le historia de commit intacte. (B)</p> Signup and view all the answers

In qual situation un git pull --force es necessari o appropriate?

<p>Quando tu ha cambiamentos local que conflicte con le remote repository e tu vole reimplaciar los. (B)</p> Signup and view all the answers

Qual command recupera tote le ramos de tote le remote repositories registrate?

<p><code>git fetch --all</code> (A)</p> Signup and view all the answers

Quante passos debe ser prendite pro crear un nove repositorio in Github?

<p>Cinque passos: crear un conto, selectionar 'Your repositories', cliccar 'New', nominar le repositorio, e specificar le visibilitate. (D)</p> Signup and view all the answers

Qual es le scopo del uso de un servitor Git remote?

<p>Pro collaborar con altere membros del equipa in un projecto. (A)</p> Signup and view all the answers

Si tu ha facite modificationes in le file introduction.txt in le branca introduction, qual commando unirea iste cambios al branca master?

<p><code>git checkout master</code> sequite de <code>git merge introduction</code>. (A)</p> Signup and view all the answers

Que es SSH in le contexto de Git e Github?

<p>Un protocoll de retic secur e encryptate usate pro authentification. (C)</p> Signup and view all the answers

Que es le prime passo pro configurar SSH pro usar con Git?

<p>Generar un clave SSH usante le commando <code>ssh-keygen</code>. (B)</p> Signup and view all the answers

Qual action non es effectuate directemente per le command git merge?

<p>Converter le branca actual a le branca desde le qual se fusiona. (B)</p> Signup and view all the answers

Qual es le differentia principal inter un repositorio Git Public e un Private in Github?

<p>Le repositorios <code>Public</code> es visibile pro tote le mundo, durante que le <code>Private</code> es solmente accessibile pro le proprietario e personas specific. (D)</p> Signup and view all the answers

Que occurre si tu tenta fusionar un branca a un alter sin prime assicurar te que tu es in le branca correcte (e.g., fusionar feature a master quando tu currentemente es in feature)?

<p>Git fusionara le branca <code>master</code> a <code>feature</code>, resultente in que <code>feature</code> contine le cambios de <code>master</code>. (A)</p> Signup and view all the answers

Flashcards

Systema de Controla de Versiones (VCS)

Un systema de controla de versiones que registra changes a un file o un gruppo de files durante le tempore.

Systema de Controla de Versiones Local

Un VCS ubi le codice es conservate in le machina local de cata programmator.

Systema de Controla de Versiones Centralisate

Un VCS ubi le codice es conservate in un servitor central e le programmatores extrahe le changes.

Systema de Controla de Versiones Distribuite

Un VCS ubi cata programmator ha un copia complete del historia del projecto.

Signup and view all the flashcards

Repositorio Git

Un directorio ubi Git registra tote le changes a tu projecto.

Signup and view all the flashcards

Snapshot in Git

Un instantanea del stato de tu files a un momento specific.

Signup and view all the flashcards

Area de staging

Le area ubi tu adde files modificate ante de committer los al repositorio.

Signup and view all the flashcards

Commit in Git

Registrar le changes del area de staging al repositorio con un message describente le changes.

Signup and view all the flashcards

Git Merge

Integrar cambios desde un branch a altere. Es necessari esser in le branch recipiente.

Signup and view all the flashcards

Git Servitores

Servitores que hospeda repositorios Git, permitente collaboration inter plure usatores.

Signup and view all the flashcards

Github

Un exemplo popular de servitor Git con interfacie web pro hospedar repositorios.

Signup and view all the flashcards

Github Account

Un account es necessari pro acceder a servicios como creation de repositorios.

Signup and view all the flashcards

Git Repository

Loco ubi tu projecto es conservate, pote esser public o private.

Signup and view all the flashcards

Repository Public

Accessibile a omne, permitte a alteres vider tu codice.

Signup and view all the flashcards

Repository Private

Solmente accessibile a usatores specificate, assecurante confidentialitate.

Signup and view all the flashcards

Protocollo

Insemble de regulas pro transmission e processamento de datos in rete.

Signup and view all the flashcards

git add

Adde un nove file al area de staging.

Signup and view all the flashcards

git commit

Salve cambios localmente in le deposito.

Signup and view all the flashcards

git remote add [nomine] [url]

Connecte tu deposito local a un deposito remote (e.g., GitHub).

Signup and view all the flashcards

git push [nomine_remoto] [branca]

Invia cambios de tu deposito local al deposito remote.

Signup and view all the flashcards

git fetch [remote]

Recupera datos del deposito remote sin integrar los.

Signup and view all the flashcards

git pull

Recupera e integra cambios del deposito remote.

Signup and view all the flashcards

git pull --rebase

git pull que reescribe tu historia de commit local pro mantener un historia plus nette.

Signup and view all the flashcards

git pull --force

git pull que fortia Git a obtener le deposito remote specificate in le branca que tu labora.

Signup and view all the flashcards

Study Notes

  • Git is a popular version control system, created by Linus Torvalds in 2005, for tracking code changes, identifying who made changes, and coding collaboration.
  • Version control systems allow programmers to record all source code modifications, enabling easy reversion to previous versions in case of errors.
  • The three main types of version control systems are local, centralized, and distributed.

Local Version Control System

  • This is the simplest, operating solely on a local computer without requiring a server.
  • The entire work history is stored locally.
  • Drawbacks include data loss if the directory is forgotten or the computer malfunctions.

Centralized Version Control System

  • Centralized version control systems exist to allow collaboration among programmers.
  • A central server stores all file change history and client computers access files from it.
  • A key weakness is that data loss occurs when the server's database is corrupted.

Distributed Version Control System

  • It addresses the limitations of centralized systems by having each client computer mirror the entire repository.
  • Each client stores all file versions and modifications, ensuring no loss of data.

Getting Started with Git

  • Preparing to use Git includes installing Git, installing a code editor, and initial configuration.

Installing Git

  • To install visit https://git-scm.com/downloads.
  • After installation, run Git Bash.

Installing Visual Studio Code

  • To install visit https://code.visualstudio.com/.

Initial Configuration

  • Integrate Git with Visual Studio Code and configure user account, default code editor and a diff tool.
  • Configure the username by typing git config --global user.name "[Your Name]".
  • Configure the email by typing git config --global user.email "[Your Email Address]".
  • Set Visual Studio Code as the default editor for Git with the command git config --global core.editor "code --wait".

Basic Git Concepts

  • Git's core concepts are a repository, workflow, hash, and file management.

Repository

  • It signifies a project in Git.
  • Repositories are created in two ways, either a new empty folder or cloning an existing project folder.

Creating a New Repository

  • To create:
    • Navigate to a directory and type cd D:\Proyek2.
    • Create a new folder with mkdir belajar-git-dasar.
    • Type cd belajar-git-dasar so Git recognizes the folder as a repository.
    • Initialize by typing git init.

Clone Repository

  • Clone consists of duplicating an existing repository, found under '[url] (directory]'`.

Snapshot

  • The term refers to capturing the state of all modified files at a specific time.
  • Git generates a SHA-1 hash value for data integrity for each snapshot.

How Git Works

  • Git tracks files with three main statuses: committed, modified, and staged.
  • Commited signify that the file is stored locally, modified means there are changes but not committed, and staged indicates preparedness for a snapshot.
  • The three sections of Git project that each Git project has are Git Directory(Repository), Working directory, and Staging area.
  • The Git Directory is where Git stores metadata, objects, and copied files
  • The working directory is where files are modified
  • The staging area is where files are prepared for committing.

File Operations

  • File operations with Git include adding, modifying, deleting, and undoing changes in the local repository.

Adding Files

  • New files are automatically placed in the working directory, where Git doesn't initially track changes.
  • Files need to be moved from the working directory to the staging area so Git can start tracking changes.
  • Use the command git add test1.txt to transfer text1.txt to staging, and git commit to save.

Modifying Files

  • Can be achived by simply editing the working directory
  • The changed file will be displayed as modified
  • The changes are displayed by the command git diff

Deleting Files

  • Start by immediately deleting or removing file in folder
  • Use the command git add test.txt
  • After file has been moved to staging area, commit

Reverting File Changes

To undo a newly added file still in the working directory

  • Execute git clean -f to remove file from workng directory.

To revert file changes in repository

  • Alter file contents and use command git restore

Reset Commit

  • The command is to completely erase a recent snapshop on a commit
  • Three ways to reset
    • git reset --soft [hash] moves pointer HEAD directory where nothing gets changed
    • git reset -- mixed [hash] moves pointer HEAD with staging area being modified without altering contents in working directory
    • git reset --hard [hash] moves pointer HEAD with both staging and working directory being modified

Branching

  • Branching lets the user create timelines with feature
  • Enables users to do work without interfering other timelines

Merge

  • When work has been perfored on a branch called feature, merging is the action to unite with other branches in master
  • To merge, the user would need to be working on branch master, afterwhich they must type git merge pendahuluan

Git Remote

  • Lets the user make a repository on the computer so they can collaborate.

Github Repository configuration

  • Create an account in Github
  • Under your Profile page, select 'Your repositories' afterwhich select 'New'
  • Then the user must fill in the repository name

Protocol on Github

  • The set of guidelines to network date
  • Protocols used on Github are SSH protocol, Git protocol, and HTTPS protocol.

Remote Repository

  • When the project is done, the project will be set to default if Git does not know about the reote.
  • Open Git Bash, then type: mkdir belajar - git - remote.

Push

  • Even if you save changes in local Git, they aren't automatically synchronized in the remote repository.
  • Use the command git push [remote repository name] [branch name].

Collaboration on Github

  • Create an 'Organization' account to collab
  • Add teammate accounts in an Organization
  • After which you may collab through pulling and pushing.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Description

Explora le differentias inter systemas de control de version local e distribuite in Git. Apprende le commandos pro creation de repositorios, registration de cambios, e discargar actualisationes. Comprende le function del 'staging area' e como usar git reset.

More Like This

Git Commands and Tagging Quiz
5 questions
Git Commands Basics
16 questions

Git Commands Basics

CharmingLorentz avatar
CharmingLorentz
Introduction to Version Control with Git
45 questions
Use Quizgecko on...
Browser
Browser