You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2016/02/07 06:35:49 UTC

[Solr Wiki] Update of "Git commit process" by ErickErickson

Dear Wiki user,

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

The "Git commit process" page has been changed by ErickErickson:
https://wiki.apache.org/solr/Git%20commit%20process

Comment:
Initial cut at "How to use Git with Lucene/Solr".

New page:
= Committing changes to Git =

<!> '''Totally incomplete, but we have to start somewhere. Please contribute!''' <!>

<!> UNDER CONSTRUCTION, INSTRUCTIONS ARE NOT COMPLETE OR EVEN GUARANTEED TO WORK <!>


'''Disclaimer''' Currently, we're still working out the preferred way of committing to Git, so this page is definitely a "work in progress". If you're a seasoned Git pro do not feel that what's written here is a ''requirement'', but do please look it over and see if it's reasonably compatible.


There's been a lot of discussion about how to commit to the Git repo since we moved to using Git in early 2016. This page is intended for people new to Git or Lucene/Solr as a place to ''start''. If you're totally new to Git or if you're a new committer, this should get you started.

NOTES:
 * Only committers have the ability to commit to the official Git repository.
 * IntelliJ and Eclipse have built-in Git integration
 * There are visual tools that may be used as well. Mention here is not an endorsement, nor is it a complete list.
  * [[https://www.sourcetreeapp.com/|SourceTree]] Free.
  * [[http://www.syntevo.com/smartgit/|SmartGit]] Licensed, not free. Well liked by at least some committers.

== Useful Links ==
There are about a zillion "how to use Git" links out there, here are a few links that are useful in this context. Except for Dawid's and Apache's pages, these are not associated with this project.
 * [[https://git-wip-us.apache.org|Git at Apache]] General Apache guidelines.
 * [[https://github.com/dweiss/lucene-git-guides|Dawid's guide]] From our very own Dawid Weiss.
 * [[http://git.or.cz/course/svn.html|Git for SVN crash course]] For people who know SVN but not Git.
 * [[http://lmgtfy.com/?q=Git+beginners+guide|Let Me Google That For You]] I've wanted to paste a link to LMGTFY for a long time...

The goal here is to provide a super-simple guide without getting off into the all the possibilities, and it will certainly seem "too simple" to sophisticated users. We all have to start somewhere.

== Git defaults ==
Here are some recommended defaults to configure Globally for Git:
{{{
git config [--global] user.name <real-name>
git config [--global] user.email <email>@apache.org

#Is this really recommended?
git config --global pull.rebase true
}}}

== Simple commits ==
For simple commits for simple JIRAs for simple people, here are a few ways of going about it.

=== method 1 ===
update your repo (perhaps with .gitconfig making this use rebasing)
 * git checkout origin/master
 * git pull
 * Make changes
 * git add (for any new files)
 * git commit -m "SOLR-#### additional comments" (commits locally, nothing in ASF yet)
 * git push

=== method 2 ===

<!> Anyone want to volunteer to add something here? <!>

=== Backporting changes from trunk to 5x (6x sometime soon) ===
The usual recommendation is to "cherry pick".
 * git checkout branch-5x
 * git cherry-pick hash (You should have seen the hash echoed when you committed to origin/master, if not and you included the SOLR-####, the JIRA will have it)
 * git commit (note this _may_ already preserve the comments from the hash you're cherry-picking from)
 * git push

<!> There has been some issue with Solr's CHANGES.txt file "cherry picking" all of the changes for trunk, so check this file especially <!>

=== Add patches to JIRA tickets or not? ===

<!> what is the consensus here? <!>

== More sophisticated options for more sophisticated people ==

<!> Hey, Git Pros! Feel free to add information here. <!>

 * [[https://github.com/dweiss/lucene-git-guides/blob/master/04-working-directly-on-a-remote-tracking-branch.sh|Dawid's Git Page]] Lots of options here, a fine way to get more sophisticated in your use of Git.