Functions
WebDev/*nix assorted functions & hacks
Search
find all
Array
-
Bash
-
Classes
-
Config
-
DateTime
-
Debug
-
dotjs
-
File
-
foooo
-
Git
-
HTML
-
Images
-
Javascript
-
Linux
-
Math
-
Misc
-
MySQL
-
OS X
-
Reading
-
Redis
-
Shell scripts
-
snippets
-
SQL
-
Strings
-
TextMate
-
Web
-
\(^o^)/ Fun!
-
_Misc hacks
-
_Pages
Git
* Readme
*_General
.gitignore for only php files
bash: gld
Branch
cloning with custom SSH port
git branch in shell prompt
how to turn a project into a bare repo
Scripts (be afraid)
Stash
URLs
11
found
auth
Name:
Category: Git
Body:
=== Git ignore === A file is modified, shows up in git status but you want to ignore it. Just adding its name to .gitignore isn't enough, use the following to re-set the 'assume unchanged' bit in the index to True, and git will ignore it until the next change, at which point .gitignore works so it'll happily *keep* ignoring it. See: http://schacon.github.com/git/git-update-index.html $ git update-index --assume-unchanged publisher.www/scratch.php If a file was already in the /remote/ repo before it was added to .gitignore, it'll keep coming back through pulls from that remote. To fix that, remove it from .gitignore, add to index, commit, push; then delete it, commit and push that, then add it to .gitignore again, compush THAT, now add the files back to the working tree. (there might be an shorter way but the above should work) >>> You can also "git rm" the file, without *actually* deleting it: $ git rm --cached <filename> === Useful things I keep forgetting === "What am I about to push?" where 'origin' is the name of the remote repo, and 'master' the branch $ git diff --stat origin/master where that last part can be other repo/branches. If this command doesn't return anything while it's also like 10 commits ahead of remote, those might be merge commits or something that it did while pulling data. Show the history of a file: $ git log -p -- <filename> Get a diff of what is staged ("Changes to be committed"): $ git diff --cached
Footer