Skip to content

Instantly share code, notes, and snippets.

View gabpy's full-sized avatar
🎯
Focusing

GabIronman gabpy

🎯
Focusing
View GitHub Profile
@henriquemenezes
henriquemenezes / postgresql-set-id-seq.sql
Created March 31, 2016 12:23
PostgreSQL set Next ID Sequence Value to MAX(id) from Table
-- Get Max ID from table
SELECT MAX(id) FROM table;
-- Get Next ID from table
SELECT nextval('table_id_seq');
-- Set Next ID Value to MAX ID
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
@andru255
andru255 / gist:6136136
Created August 1, 2013 23:05
Hacer pull sin hacer commit ni add, una buena jugada
.. luego de haber hecho tus cambios sin aplicar add ni commit y querés aplicar pull se hace lo siguiente:
el git stash almacena una rama temporal donde toma tus cambios
$ git stash
aplicamos el pull correspondiente..
$ git pull origin [mi-rama]
y luego retornamos los cambios de la rama temporal
$ git stash apply stash@{0}