Skip to content

Instantly share code, notes, and snippets.

@fernandoPalaciosGit
Last active January 22, 2020 14:38
Show Gist options
  • Select an option

  • Save fernandoPalaciosGit/04e5726e6233d3742aa4 to your computer and use it in GitHub Desktop.

Select an option

Save fernandoPalaciosGit/04e5726e6233d3742aa4 to your computer and use it in GitHub Desktop.
Git commands

listar repositorios remoto

$git remote -v

sincronizar remoto con local

$git remote add [remote-name] [remote-url]

$git push -u [remote-name] [remote-url]

sincronizar forks remotos en local antes del PR (sobreescribimos por encima de nuestro master)

# $git remote add upstream [url-upstream]
# $git checkout master
$git fetch upstream
$git rebase upstream/master
# solucionar conflictos y commit
$git push -f origin master

modificar la url de remotos

$git remote set-url [remote-name] [remote-url]

credenciales

$git config --global [user.name | user.email]

$git config --global color.ui true

working flow branches

$git branch -a

$gi checkout [branch]

$git checkout -b [name-branch]

$cat .git/config

$git push -u origin [name-branch]

delete local branch

$git branch -D [branch-name]

delete remote branch

$git push origin --delete [branch-name]

REMOTE STATUS

$git remote show [remote-branch-name] -> (up to date) || (fast forwardable)

$git log origin/master // all commits in remote

$git show origin/master --summary //last commit in remote

forzar el push a un repo remoto

$git push --force [remote-url/name] [remote-branch]

publish npm versions

1- crear un nuevo tag en el repositorio privado y en el publico

git tag -a v0.8.22

2- publicar el nuevo tag en registro de nexus de packages (Alvaro, Turo y los mentors)

git push origin v0.8.22
git push odf v0.8.22 /*odf es la url del repo publico*/

3- comitar la nueva version en el package json y PR a publico

limpiar cache de sincronizacion de ramas

rm -rf node_modules/gh-pages/.cache

clean working directory

git add .
git reset --hard

Shallow copy, clone last comit

git clone --depth=1 %URL_OF_YOUR_FORK% .
git pull --unshallow
``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment