Академический Документы
Профессиональный Документы
Культура Документы
ComandosbsicosparamanejarseconGityGitHub
David Rey
Software developer in a permanent beta mindset Open
Source and Clean Code Lover
https://dreyacosta.com/comandosbasicosparamanejarsecongitygithub/
1/11
9/4/2016
ComandosbsicosparamanejarseconGityGitHub
Comienza Ahora
15DEABRILSLOENCINESYEN3D
Qu es Github
Bsicamente Github es un servicio de alojamiento de repositorios de software
que ofrece opciones muy interesantes para trabajar en equipo. GitHub est
basado en Git, un sistema de control de versiones muy popular entre los
desarrolladores.
2/11
9/4/2016
ComandosbsicosparamanejarseconGityGitHub
$brewinstallgit
$aptgetinstallgitcore
Si prefers podis bajaros la versin con interfaz grca de GitHub tanto para
Windows como Mac OS X.
CONFIGURANDO GIT
Es importante congurar Git una vez tenemos una instalacin correcta. Para
ello:
$gitconfigglobaluser.name"David"
$gitconfigglobaluser.email"tuemail@dominio.com"
$sshkeygentrsaCtuemail@dominio.com
https://dreyacosta.com/comandosbasicosparamanejarsecongitygithub/
3/11
9/4/2016
ComandosbsicosparamanejarseconGityGitHub
Deberemos indicar nuestra clave SSH a GitHub por lo que dentro de Account
Settings en SSH Keys pegaremos la clave que acabamos de generar.
https://dreyacosta.com/comandosbasicosparamanejarsecongitygithub/
4/11
9/4/2016
ComandosbsicosparamanejarseconGityGitHub
Anuncios Google
Actualizarsoftware
ComandosCMD
GITSourcecontrol
Comienza Ahora
Anuncios Google
GITClone
GITPull
MacGIT
$gitinit
https://dreyacosta.com/comandosbasicosparamanejarsecongitygithub/
5/11
9/4/2016
ComandosbsicosparamanejarseconGityGitHub
$viREADME.md
Pulsamos ESC y :wq para guardar y salir del chero. As mismo debemos
aadir a Git los cheros modicados.
$gitaddREADME.md
Ahora vamos a indicar a Git un comentario sobre las modicaciones que hemos
realizado en el chero (esto es un commit) ya que de lo contrario no podremos
enviar los cambios al repositorio.
$gitcommitmMiprimeracontribucionalproyecto
https://dreyacosta.com/comandosbasicosparamanejarsecongitygithub/
6/11
9/4/2016
ComandosbsicosparamanejarseconGityGitHub
$gitremoteaddorigingit@github.com:dreyacosta/testinggithub.git
Una vez conectados los repositorios ya podemos enviar los cambios hacia
GitHub.
$gitpushoriginmaster
https://dreyacosta.com/comandosbasicosparamanejarsecongitygithub/
7/11
9/4/2016
ComandosbsicosparamanejarseconGityGitHub
#CREANDOUNNUEVOBRANCH
$gitbranchnombredelbranch
#CAMBIARSEDEBRANCH
$gitcheckoutnombredelbrach
#VIENDOLOSBRANCHESDELPROYECTO
#(elasteriscoindicaelbranchdondeestamos)
$gitbranch
#UNIFICANDOBRANCHES
#(estoactualizaelbranchdondeestamosconlos
#cambiosquetengaelbranchqueindiquemos)
$gitmergeNombreDelBranchAunificar
usage:git[version][execpath[=]][htmlpath][manpath][infopath]
[p|paginate|nopager][noreplaceobjects][bare]
[gitdir=][worktree=][namespace=]
[cname=value][help]
command[args]
Themostcommonlyusedgitcommandsare:
addAddfilecontentstotheindex
https://dreyacosta.com/comandosbasicosparamanejarsecongitygithub/
8/11
9/4/2016
ComandosbsicosparamanejarseconGityGitHub
bisectFindbybinarysearchthechangethatintroducedabug
branchList,create,ordeletebranches
checkoutCheckoutabranchorpathstotheworkingtree
cloneClonearepositoryintoanewdirectory
commitRecordchangestotherepository
diffShowchangesbetweencommits,commitandworkingtree,etc
fetchDownloadobjectsandrefsfromanotherrepository
grepPrintlinesmatchingapattern
initCreateanemptygitrepositoryorreinitializeanexistingone
logShowcommitlogs
mergeJointwoormoredevelopmenthistoriestogether
mvMoveorrenameafile,adirectory,orasymlink
pullFetchfromandmergewithanotherrepositoryoralocalbranch
pushUpdateremoterefsalongwithassociatedobjects
rebaseForwardportlocalcommitstotheupdatedupstreamhead
resetResetcurrentHEADtothespecifiedstate
rmRemovefilesfromtheworkingtreeandfromtheindex
showShowvarioustypesofobjects
statusShowtheworkingtreestatus
tagCreate,list,deleteorverifyatagobjectsignedwithGPG
15DEABRILSLOENCINESYEN3D
https://dreyacosta.com/comandosbasicosparamanejarsecongitygithub/
9/11