User login

version control

Command line Git on Windows

A principal at Agaric regrettably uses Microsoft Windows as a primary operating system. In fact, though, everything works great for him using the open source integrated development environment Eclipse to develop, including using the eGit plugin-- except when something goes wrong, and my (limited) command line knowledge of Git is useless to help him.

Fortunately, it turns out to be pretty easy to have command-line Git on Windows with Eclipse, it just isn't well documented.

Git remote branches are different on my local compared to server

The local checkout on my computer and the one on the dev server are looking at the same Git repository, but the results of git branch -a (show all remote branches) is very different.

Reason: git pull origin master does not get all the branch and tag information the way git fetch does!

Solution:

git fetch origin

Now git branch -a and git checkout branchicareabout both work.

Procedure for resolving a a left-behind branch that has merge conflicts

DRAFT. Better methods from better minds invited!

Situation: Someone has been working away wonderfully on a git branch on your project. You do some crazy stuff with it over the weekend, and when they, on their continnum branch, go git pull --rebase origin continuum and get conflicts they don't know how to deal with, or when they go git fetch origin and git rebase master and have conflicts.

You want to take this off their hands.

Quickly search for a git commit hash based on a key word

git log --pretty=oneline | grep 'award'

If you see every git log entry twice

If you have an unexpectedly long merge time and you see every commit in your git log showing up two times, you or someone else probably changed the history of the repository (such as to remove a big binary file). This changes the commit hash of every commit there is, so when merging these two (actually separate but just happen to have the same code) repositories you'll see them all twice in the history.

Throw out all local changes to a file with Git

git checkout filename

Automatically deletion of files to commit as well as new and modified files

git add -u

picks up the deleted files, and stages their deletion to be committed.

Also gets modified files. Still needs git add . to pick up the new files.

Syndicate content