How do I discard unstaged changes in Git?

For a specific file use:

git checkout path/to/file/to/revert
For all unstaged files use:

git checkout – – .
Make sure to include the period at the end.


Setting up the SMTP Gmail service for the gitlab CE local server at ubuntu 14.04

If you would rather send application email via an SMTP server instead of via Sendmail, add the following configuration information to /etc/gitlab/gitlab.rb and run gitlab-ctl reconfigure.


gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = ""
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = ""
gitlab_rails['smtp_password'] = "my-gmail-password"
gitlab_rails['smtp_domain'] = ""
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'peer' # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see

Don't forget to change to your email address and my-gmail-password to your own password.

Creating Local GitLab Repo Server at ubuntu14.04



Creating / Uploading New Repository to Git

  1. Create a new repository at git with your account ( in browser )
  2. At terminal, go under your new repository folder
  3. git add * ( adding all your files to git )
  4. git commit -m “Initial commit” ( adding commit for your first commit )
  5. git remote add origin ssh://
  6. git push -u origin master