Hey Brock, I usually use "git status" to see where my local stands vs. the remote. To get an up-to-date snapshot, you would have to do a "git fetch origin" first.
I just remembered about "git show" from reading the following thread (by the end of the comments the author has a workable solution for seeing local differences): http://drupal.org/node/1175950 So you could do something like: git fetch origin git status git show -n5 # or however many commits you want to look back at # any rebase/edit necessary, repeat above git status git push origin trunk As far as working on other branches, there is more than one way to skin a cat in git but I often work on a feature / JIRA-specific branch, then switch to trunk and cherry-pick my changes from the branch. Then I run the tests and create the diff using something like "git diff --no-prefix HEAD~1 HEAD > FLUME-xxxx.patch". For applying patches, I do something like this: git checkout trunk git fetch origin git status # ensure no changes patch -p0 < FLUME-yyyy.patch git status git add ... git commit mvn clean install mvn clean git status # ensure only one commit (no merge commits) git push origin trunk Regards, Mike On Thu, Aug 16, 2012 at 1:32 AM, Brock Noland <[email protected]> wrote: > Is it possible to get a general idea of the commands you ran push local > commits? I am no git ninja so I want to be sure I don't push any local > commits. > > As a side, I have what I hope is a very conservative development model > below. If I am doing something dangerous, please let me know! > > to work on a jira: > > git checkout trunk > git checkout -b FLUME-XXXX > git commit -m "commit message" > git commit -m "commit message" > git commit -m "commit message" > git merge trunk > git diff --no-prefix trunk > /tmp/FLUME-XXXX.patch > > and to commit something to trunk > > git checkout trunk > patch -p0 --dry-run < /tmp/FLUME-XXXX.patch > patch -p0 < /tmp/FLUME-XXXX.patch > mvn test > git status > git diff > git commit -m "commit message" > > Brock > > On Thu, Aug 16, 2012 at 2:35 AM, Juhani Connolly < > [email protected]> wrote: > > > The local commits of mine that were pushed were just me applying the same > > patches that were applied to the trunk, just in a slightly different > order. > > I did do a diff against the trunk before pushing, and the only > difference > > was the contents of the patch. The final state of the trunk should be > > consistent with what it was before + the changes from 1382.I was under > the > > false assumption I had grokked git from using it internally but clearly > > missed some details. Seeing as this apparently cannot easily be reversed > I > > will take extra care in the future. > > > > > > On 08/15/2012 05:25 PM, Hari Shreedharan wrote: > > > >> Don't worry about it. We don't seem to have lost any data, just that > >> there are some local commits of yours which you probably didn't intend > to > >> push. I am hoping this will be fixed soon, so we can reopen trunk for > >> commits. > >> > >> > >> Hari > >> > >> > > > > > -- > Apache MRUnit - Unit testing MapReduce - > http://incubator.apache.org/mrunit/ >
