Skip to main content

Git: introducción, comandos básicos

Tutoriales y documentación

Git Tutorial (W3Schools)
https://www.w3schools.com/git/default.asp


 Git Cheat Sheet

$ git init [name] Create a new repository in the project folder with the specified name
$ git clone (repo URL) Download a project from Github along with its entire version history
$ git clone (repo URL) (folder) Downloads a repository to a specific local folder
$ git remote -v Display a list of remote repositories along with URLs
$ git remote rm (remote repo name) Remove a remote repository
$ git pull Retrieve the most recent changes from origin and merge
$ git add (file name) Add the file to the repository, ready for commit
$ git add Add all untracked files to the repository, ready for commit
$ git rm (file_name) Remove a file and stop delete it from the working directory
$ git status Display the status of all new or modified files to be committed
$ git commit -m "[message]" Add file snapshot permanently in version history
$ git branch Lists all local branches in the current repository
$ git branch [name] Create a new branch
$ git fetch remote [name] Fetch the required branch
$ git checkout [name] Switch to the specified branch and update the working directory
$ git merge [branch] Combine the specified branch’s history into your current branch
$ git branch -d [name] Delete the specified branch
$ git push –all Push all local branches to the remote repository