Skip to content

Instantly share code, notes, and snippets.

@fabiancarlos
Last active October 12, 2015 05:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiancarlos/3977332 to your computer and use it in GitHub Desktop.
Save fabiancarlos/3977332 to your computer and use it in GitHub Desktop.
Git Essential Comands
git init # initalize a empty git repo
git status # check modifications in the repo repo
git log # check commits in the git repo
git add . # add all existing files to staged.
git add some/repository/config # add respective file named 'config' to staged
git add -u . # add all untracked files to staged.
git add -u some/repository/config # add respective untracked file named 'config' to staged.
git commit # open the editor text to add a description and when finished, add staged files to repository.
git commit -m "some description" # add staged files to repository
git reset # removes all staged files
git reset --hard # removes staged and working directory changes.
git clean -f -d # remove untracked files.
git clean -f -x -d # CAUTION: as above but removes ignored files like config.
rake --tasks # show list of all rake tasks available

remote stuff

git clone "htts://some_link/some_stuff.git"  # clone a git repo
git remote -v # check the remote links
git push origin master # push the local modifications to a remote git repo | origin: the link, master: the branch
git pull origin master # pull the remote modifications to your local repo | origin: the link, master: the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment