Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucy Wiki" for change 
notification.

The "GitCheatSheet" page has been changed by nwellnhof:
http://wiki.apache.org/lucy/GitCheatSheet

New page:
= Git setup =

If you're a first time Git user, set up your global Git configuration first:

{{{
git config --global user.name "John Doe"
git config --global user.email [email protected]
}}}

Enabling color output is highly recommended:

{{{
git config --global color.ui auto
}}}

You can also create your own global .gitignore file in $HOME, and put rules for 
your editor temp files in there. Enable it like this:

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

By default, 'git push' without arguments pushes all local branches to existing 
branches with the same name on the remote. This is not what most users expect. 
It is recommended to change the 'push.default' setting to 'upstream', so only 
the current branch will be pushed to its upstream branch.

{{{
git config --global push.default upstream
}}}

= Cloning =

To clone a repository:

{{{
# Non Committers
git clone http://git-wip-us.apache.org/repos/asf/lucy.git

# Committers
git clone https://git-wip-us.apache.org/repos/asf/lucy.git
}}}

= Standard workflow =

{{{
git checkout <branch>
git pull --rebase
[edit]
git commit
git push
}}}

= Working with branches =

Create and switch to a local branch:

{{{
git checkout -b <branch>
}}}

Push local branch to remote for the first time:

{{{
git push -u origin <branch>
}}}

Use the -u option to automatically setup the remote tracking configuration.

Checkout a remote tracking branch:

{{{
git checkout --track origin/<branch>
}}}

Delete a remote branch:

{{{
git push origin :<branch>
}}}

Reply via email to