Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
sudo apt-get install git-core
gitk

Install Git on Mac OS

To install using macports, follow instructions here.

...

To make all commits clear/legible/accessible, please configure git to use your full, real name and email. This means...

user.name must be your real/legal first and last name. Do not abbreviate either. If you have more than two names, pick the two you are most commonly known by.

...

Add files to the git "index" so they will be committed with "git add". Optionally, instead of running "git add", include -a when running "git commit" to commit all local modifications except new files. Then, commit:

No Format
git commit

In Git, the first 80 characters of the first line are, by convention, a summary of the rest of the log message. See Commit Log Guide.

...

No Format
git push origin master

Update your master branch

No Format
git pull --rebase origin master

Using rebase is recommended to keep the commit history graph clean. Specifically, trivial merges cause a great deal of clutter. We may eventually institute a server side hook to prevent trivial merges.

Creating a patch

Here are two suggestions.

...

No Format
git format-patch -1origin/master

2) If you have a public git repository, create a pull request, with for example something like this:

...

No Format
git branch NAME_OF_BRANCH

Deleting a local branch

No Format
git branch -d NAME_OF_BRANCH

List branches

Local branches can be listed with:

No Format
git branch

To see all "remote" branches:

No Format
git branch -a

Note that "remote branch" really means a local copy of a remote branch.

...

No Format
git checkout BRANCH_TO_MERGE_CHANGES_TO
git merge OTHER_BRANCH

More on merging

Again, see Pro Git: Basic Branching and Merging.

Moving changes from one repository to another

I'm not sure which way is best.

Cut and Paste

Say you wanted to merge a change from "head" to "1.5.x". Create a patch with "git format-patch". Apply the patch to the other repository with "git am".

Branch and Merge

Say you're following Mifos "head", and you want to pull a change from the 1.5.x line of development. You first have to do:

No Format
git remote add 1.5.x ssh://USERNAME@mifos.git.sourceforge.net/gitroot/mifos/1.5.x

Then you mirror the branch "master" from the remote repository "1.5.x", pull in a change, and push it back up to "head":

No Format
git fetch 1.5.x
git cherry-pick 5948a92795197bc4e6577173445d0efac09130ae
git push origin master

Resolving merge conflicts

...