Skip navigation

Category Archives: git

git checkout -t origin/haml

Advertisements

git revert [–edit | –no-edit] [-n] [-m parent-number] [-s] <commit>

You can find the git commit you want to delete by looking at your git log. git show-branch also can help but it wont show the commit id. The commit id is probably a long hash.

For example:

git revert ddd5e0a8d79cc4ace25828b5386e15be82ada519

Reverted a commit I just made. The -n option will prevent the change from being committed automatically.

Posted via web from Apphacker’s learning curve

I normally use “git remote show origin” You can also get a quick overview with git remote -v.

It’s not quite the same as svn info but it’s a great way to see your remote URL.

Posted via web from Apphacker’s learning curve

git checkout foo

That will reset foo to HEAD. You can also:

git checkout HEAD^ foo

There are more interesting details on that Stackoverflow question. This is equivalent to ‘svn revert’ in subversion.

Posted via web from Apphacker’s learning curve

This one is pretty easy, but for the fact that the built-in help doesn’t mention git ls-files.

To view deleted files use git ls-files –deleted

To restore deted files just use git checkout – <deleted_file>

Too easy.

In svn you’d simply type ‘svn up’ and deleted files would be restored. A little bit more involved with git.

Posted via web from Apphacker’s learning curve