Github Resumen

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

GIT = distributed version control system $ git clone ssh://user@domain.com/repo.

git used to point to an exis


CREAR REPO BRANCH
I $ git init [proyecto] B $ git branch C
creates a new Git repository list all local branch
B $ git branch -av A
local branch and remote

C $ git checkout branch R


MIRAR REPO switches to specified branch
S $ git status C $ git checkout file R
Discard local changes in a specific file
L $ git log M $ git merge branch C
show full change history combine two branch

D $ git diff joins two or more development histories together B


takes two input data sets and outputs the
changes between them
S $ git show T $ git tag [name] T
view expanded details on Git objects tag current commit
R $ git reset -- hard HEAD~1
reset all last commit
used to point to an existing repo and make a clone or copy of that repo at in a new directory, at another location
CHANGES SINCRONIZAR
$ git commit - m P $ git pull
commit all staged to local repository get latest changes from origin NO MERGE
$ git add . F $ git fetch <remote>
promote pending changes from the working Download all changes from <remote>, but don‘t
directory to the staging area. integrate into HEAD
$ git reset P $ git push
unstages files keeping the changes push local changes to origin
$ git reset -hard P $ git pull -- rebase
revert all to last commit fetch latest changes from origin and rebase
$ git cherry-pick P $ git pull -f
picking a commit from a branch and reapplies commits on top of another base
applying it to another branch
$ git branch -d <branch> MERGE vs REBASE
Delete a local branch merge preserves history as it happened, rebase
rewrites it
$ git tag <tag-name>
Mark the current commit with a tag

You might also like