├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 carlos guajardo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Git Commands and Terminal / Comandos de GIT y Terminal 2 | ============ 3 | 4 | _A list of commonly used Git and Terminal commands_ 5 | 6 | *Una pequeña lista de los comandos mas utilizados en Git y la Terminal* 7 | 8 | -- 9 | 10 | ### Terminal Commands / Comandos de la Terminal 11 | 12 | | Command | Description | Descripción | 13 | | ------- | ----------- | ------------ | 14 | | `cd [rute]` | To change directory | Cambia el directorio | 15 | | `mkdir [name]` | Make directory | Crea una nueva carpeta | 16 | | `ls -a` | List information about the files | Lista los archivos del directorio | 17 | | `clear` | clear the terminal screen | Limpia la Terminal | 18 | | `Touch [name.txt]` | create a empty file | Crea un archivo vacio | 19 | | `rm [file]` | remove files | Elimina un archivo | 20 | | `rm -rf [dir]` | remove directories | Elimina una carpeta | 21 | | `pwd` | Print name of current/working directory | Muestra el directorio donde nos encontramos | 22 | | `mv` | move (rename) files | Mueve o renombra archivos | 23 | | `cat [name.txt]` | Concatenate files and print on the standard output | Vista previa del contenido del archivo | 24 | | `sudo` | execute a command as another user | Ejecuta un commando como administrador | 25 | 26 | ### Config Git / Configuracion de Git 27 | 28 | | Command | Description | Descripción | 29 | | ------- | ----------- | ------------ | 30 | | `git config --global user.name "name-example"` | Add a user name | Añade un nombre de usuario | 31 | | `git config --global user.email user@example.com` | Add a email for user | Añade un correo del usuario | 32 | | `git config --list` | List all setings | Muestra todas las configuraciones | 33 | 34 | ### Config SSH Keys / Configuracion de Credenciales SSH 35 | 36 | | Command | Description | Descripción | 37 | | ------- | ----------- | ------------ | 38 | | `ssh-keygen -t rsa -b 4096 -C "Email"` | Generate SSH key | Generar credencial SSH | 39 | | `eval $(ssh-agent -s)` | Verify ssh agent | Verifica la existencia del servidor de credenciales SSH | 40 | | `ssh-add [rute]` | Add SSH key to your workspace | Agrega la credencial SSH al entorno de trabajo | 41 | 42 | ### Creating Projects / Creacion de proyectos 43 | 44 | | Command | Description | Descripción | 45 | | ------- | ----------- | ------------ | 46 | | `git init` | Initialize a local Git repository | Inicia un repositorio local de Git | 47 | | `git clone [url]` | Create a local copy of a remote repository | Crea una copia local de un repositorio remoto | 48 | 49 | ### Basic Snapshotting / Snapshooting Basico 50 | 51 | | Command | Description | Descripción | 52 | | ------- | ----------- | ----------- | 53 | | `git status` | Check status | Verifica el estatus del repositorio | 54 | | `git add [file-name.txt]` | Add a file to the staging area | Añade un archivo al area de preparación | 55 | | `git add .` | Add all new and changed files to the staging area | Añade todos los archivos al area de preparación | 56 | | `git commit -m "[commit message]"` | Commit changes | Añade los archivos al repositorio | 57 | | `git commit -am "[commit message]"` |Add changed files and commit | Añande los cambios y hace commit | 58 | | `git rm -r [file-name.txt]` | Remove a file (or folder) | Elimina archivos o carpetas | 59 | | `git commit --amend` | Ammend the last commit | Agrega los cambios al ultimo commit en caso de error | 60 | 61 | ### Branching & Merging / Ramas y fusionar 62 | 63 | | Command | Description | Descripción | 64 | | ------- | ----------- | ----------- | 65 | | `git branch` | List branches (the asterisk denotes the current branch) | Lista todas las ramas | 66 | | `git branch -a` | List all branches (local and remote) | Lista todas las ramas locales y remotas | 67 | | `git branch [branch name]` | Create a new branch | Crea una nueva rama | 68 | | `git branch -d [branch name]` | Delete a branch | Elimina una rama | 69 | | `git show-branch --all` | List all branches local | Lista todas las ramas en local | 70 | | `git push origin --delete [branch name]` | Delete a remote branch | Elimina una rama remota | 71 | | `git checkout -b [branch name]` | Create a new branch and switch to it | Crea una nueva rama y cambia a ella | 72 | | `git checkout -b [branch name] origin/[branch name]` | Clone a remote branch and switch to it | Clona una rama remota y cambia a ella | 73 | | `git checkout [branch name]` | Switch to a branch | Cambiar a una rama determinada | 74 | | `git checkout -` | Switch to the branch last checked out | Cambia a la ultima rama seleccionada | 75 | | `git checkout -- [file-name.txt]` | Discard changes to a file | Descarta los cambios de un archivo | 76 | | `git merge [branch name]` | Merge a branch into the active branch | Fusiona una rama a la rama activa 77 | | `git merge [source branch] [target branch]` | Merge a branch into a target branch | Fusiona una rama a una rama determinada | 78 | | `git stash` | Stash changes in a dirty working directory | 79 | | `git stash clear` | Remove all stashed entries | 80 | 81 | ### Sharing & Updating Projects / Compartiendo y Repositorios Remotos 82 | 83 | | Command | Description | Descripción | 84 | | ------- | ----------- | ----------- | 85 | | `git push origin [branch name]` | Push a branch to your remote repository | Envia el repositorio local a remoto | 86 | | `git push origin --delete [branch name]` | Delete a remote branch | Elimina un repositorio remoto | 87 | | `git pull` | Update local repository to the newest commit | 88 | | `git pull origin [branch name]` | Pull changes from remote repository | Hace un feth y fusiona 89 | | `git remote add origin ssh://git@github.com/[username]/[repository-name].git` | Add a remote repository | Crea un repositorio remoto | 90 | | `fork` | Copy a external repository | Copa un repositorio externo | 91 | | `git remote -v` | list remote connections | Lista las conexiones remotas | 92 | | `git remote set-url [branch name] [url]` | Change the url | Cambia la url del repositorio | 93 | 94 | ### Inspection & Comparison / Inspeccion y Comparacion 95 | 96 | | Command | Description | Descripción | 97 | | ------- | ----------- | ----------- | 98 | | `git log` | View changes | Muestra los cambios en el repositorio | 99 | | `git log --summary` | View changes (detailed) | Muestra los cambios en el repositorio detalladamente | 100 | | `git log -all --graph --decorate --oneline` | View changes (Max-detailed) | Muestra todos los cambios del repositorio detallada y graficamente | 101 | | `git diff [source branch] [target branch]` | Preview changes before merging | Compara los diferentes cambios | 102 | 103 | ### Reset 104 | | Command | Description | Descripción | 105 | | ------- | ----------- | ----------- | 106 | | `git reset --soft [SHA1]` | Remove commits but leave the files in the staging area | Elimina commits pero deja los archivos en el staging area | 107 | | `git reset --mixed [SHA1]` | Remove commits and the files are left in the working directory | Elimina commits y los archivos quedan en el working directory | 108 | | `git reset --hard [SHA1]` | It eliminates changes to us even from the working directory | Nos elimina los cambios incluso del working directory | 109 | 110 | ### Others / Otros 111 | 112 | | Command | Description | Descripción | 113 | | ------- | ----------- | ----------- | 114 | | `alias [name=] "command"` | Create a shorcut for a command | Crea un alias para llamar a un comando | 115 | | `git tag -a [name] -m "message" [id/hashtag]` | Create a tag for a commit | Crea un tag de un commit en especifico | 116 | | `git show-ref --tags` | List all tags | Lista los tags existentes | 117 | | `git push --tags` | Push tags to your repository | Envia los tags al repositorio remoto | 118 | | `git tag -d [name]` | Delete a tag | Elimina un tag en especifico | 119 | | `git push origin :refs/tags/[name]` | Delete a tag from GitHub | Elimina un tag dentro de GitHub | 120 | | `gitk` | Open GUI | Abre una interfaz grafica | 121 | | `git cherry.pick [id]` | Take commit from other branches | Trae un commit especifico desde otra rama | 122 | | `git grep -n [word]` | Search words in the proyect | Busca la palabra especificada en todo el proyecto | 123 | 124 | 125 | --------------------------------------------------------------------------------