User login

version control

Understanding past changes with diff and git log

In figuring out what changed in a theme's files (an incorrectly made subtheme; instead of overriding the base themes stylesheets, changes should have gone into its own files with different names), these commands were useful.

diff -uP themes/bartik/css/colors.css sites/default/themes/dgd7theme/css/style.css > theme.diff
git log --cc sites/default/themes/dgd7theme/css/style.css > log.diff

Kept running them for the three different files, and reloading theme.diff and log.diff in gvim to see the changes. Quite convenient.

Pushing our local repository to Gitorious

git checkout master
git remote add origin
git push origin master

This was for a module named "remarkup" as covered in

Git undo part of a commit

To revert an entire commit.

git checkout <file>
re-checkout <file>, overwriting any local changes

Should be able to git add changed files that you are interested in committing the revised changes and git commit --amend

See what's about to be committed when using git, and remove something before committing

git diff of files that have been staged ie 'git add'ed
git diff --cached

$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)

And just commit again.

Undo a git add - remove files staged for a git commit

git reset filename.txt

Will remove a file named filename.txt from the current index, the "about to be committed" area, without changing anything else.

To undo git add . use git reset (no dot).

Ignore all Vim temporary files

v ~/.gitignore


git config --global core.excludesfile ~/.gitignore

Syndicate content