git
Git is a revision control management tool by Linus Torvalds.
Checkout Cheat Sheet
Git is a revision control management tool by Linus Torvalds.
Checkout Cheat Sheet
When contributing to open source you may face a problem – your fork is outdated. There could be another scenario – git repo in Github is just mirror of perforce repo, so after your pull request is merged there won't be your commits in repo and you again will have to sync fork and origin.
git remote add upstream git://github.com/username/repo.git
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
Put this in your .gitconfig:
[alias]
rma = !sh -c \"git diff -z --name-only --diff-filter=D | xargs -0 git rm\"
Then just type git rma to stage them. Very handy when updating plugins and things like that!
It can be done via get query: https://github.com/rails/rails/commits/master?author=kirs
git push REPO LOCAL_BRANCH:REMOTE_BRANCH #git
git checkout stash@{0} -- app/views/spree/shared/_filters.html.erb
More tricks can be found on stackoverflow. #git #stash #hint #tip
sudo apt-get install dos2unix
Change line endings on files recursively: find path/to/file -type f -exec dos2unix {} +
If you want to stage all changes (including file deletions, renamings etc.) but not new files, unlike git add -A does, you should use git add -u or git add --update: More under the cut
Currently I am doing migration to #ruby 1.9.3 of my old app so I need to append
# encoding: utf-8
everywhere but except for vendor folder and probably db. So here is nice gem for it:
https://github.com/m-ryan/magic_encoding
If you forget to specify path for applying magic comments you can undo changes if you are #git user like this:
git checkout -- db/migrate/
git checkout -- vendor/
Gistflow Notifier shows your notifications on OS X Notification Center.
How to install:
curl https://raw.github.com/gistflow/notifier/master/bin/setup > /tmp/setup
ruby /tmp/setup
#git and #ruby (any) required.
Please comment about all your problems.
If you don't want to clone all #git repo, for example:
git clone git://github.com/rubinius/rubinius.git
Cloning into 'rubinius'...
remote: Counting objects: 226027, done.
remote: Compressing objects: 100% (55389/55389), done.
Receiving objects: 35% (79200/226027), 20.39 MiB | 32 KiB/s
which git UI u prefer to use?
Remove branches already merged to current branch from local and remote repository. More under the cut
I you need to keep local changes in file which tracked by #git, just do:
git update-index --skip-worktree config/database.yml
I use #textmate in my everyday work and from time to time I understand I want more out of it and look for interesting bundles.
Yesterday I installed #git #bundle and was surprised how useful it is. More under the cut
Short git version you can get with this command:
git describe --always
While coding a big project, branches are accumulated and #git log becomes ugly. So lets delete old stuff from your local and remote repos. Git commands are under the cut.
Take a look at these one I found at sixrevisions: http://sixrevisions.com/resources/git-tutorials-beginners/.
I prefer this one: http://gitimmersion.com/. More under the cut