Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasperf/8286c69c30d830b87abe to your computer and use it in GitHub Desktop.
Save jasperf/8286c69c30d830b87abe to your computer and use it in GitHub Desktop.
Useful Git commands for everyday management Repo #git
adduser --home /var/www <your_user>
su - <new_user>
//add user to webserver group Debian Ubuntu
useradd -G www-data username
ssh-keygen
cat .ssh/id_rsa.pub
//and add this content on BB
//https://gist.github.com/oodavid/1809044
//add and commit all
git commit -am "commit message"
//OR
git add -A && git commit -m "fixed duplicates"
//check status repo to see if any changes were made or files were added.
git status
// Check all commits by date
git reflog --date=iso
//Compare two commits by reference id number (pick most recent one) to see what files have changed.
git diff-tree --no-commit-id --name-only -r number
//then see changes in one file compared to its state in previous commit
git diff HEAD^ HEAD /path/to/file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment