On Tue, Aug 13, 2013 at 12:25 PM, Sean Carte <sean.ca...@gmail.com> wrote:
>
> On 13 August 2013 12:10, helix84 <heli...@centrum.sk> wrote:
>>
>> no worries, we've all been through this. To overwrite your local
>> changes in one file with the upstream version of that file, do
>>
>> git checkout dspace/config/dspace.cfg
>
>
> Thanks, Ivan.
>
> So that puts dspace/config/dspace.cfg into the fetched files? What if there
> were changes in the newly fetched dspace.cfg. Would those get merged into my
> dspace.cfg?

No, using checkout, you're explicitly asking for the HEAD version of
the file (you could also ask for any other version of the file, e.g.
git checkout dspace-1.8.2 dspace/config/dspace.cfg).
Honestly, I'm not sure why this didn't get merged with a conflict
after you did git merge, like the other files below. I'd have to see
it to figure it out.


>> Should you have many locally mddified files and you wish to throw away
>> the changes, I know of two ways to do that, but use them with care:
>> a) git reset --hard HEAD
>> b) git stash save && git stash drop
>
>
> I want to keep my local changes though, don't I?
>
> So I did:
>
> dspace@ubuntu:~/dspace-src-git$ git checkout dspace/config/dspace.cfg
>
> dspace@ubuntu:~/dspace-src-git$ git merge upstream/master
>
> and got a bunch of errors:
>
> warning: Cannot merge binary files: dspace/docs/DSpace-Manual.pdf (HEAD vs.
> upstream/master)
>
> Auto-merging src/main/assembly/testEnvironment.xml
> CONFLICT (add/add): Merge conflict in src/main/assembly/testEnvironment.xml
> Auto-merging pom.xml
> CONFLICT (add/add): Merge conflict in pom.xml
> Auto-merging dspace/src/main/config/build.xml
> CONFLICT (add/add): Merge conflict in dspace/src/main/config/build.xml
> Auto-merging dspace/src/main/assembly/assembly.xml
> CONFLICT (add/add): Merge conflict in dspace/src/main/assembly/assembly.xml
> Auto-merging dspace/solr/statistics/conf/solrconfig.xml
> CONFLICT (add/add): Merge conflict in
> dspace/solr/statistics/conf/solrconfig.xml
> Auto-merging dspace/solr/statistics/conf/schema.xml
> CONFLICT (add/add): Merge conflict in dspace/solr/statistics/conf/schema.xml
> Auto-merging dspace/solr/oai/conf/solrconfig.xml
> CONFLICT (add/add): Merge conflict in dspace/solr/oai/conf/solrconfig.xml
> Auto-merging dspace/pom.xml
> ...
> Auto-merging dspace-api/pom.xml
> CONFLICT (add/add): Merge conflict in dspace-api/pom.xml
> Auto-merging build.properties
> CONFLICT (add/add): Merge conflict in build.properties
> Auto-merging .gitignore
> CONFLICT (add/add): Merge conflict in .gitignore
> Automatic merge failed; fix conflicts and then commit the result.
>
> Do I need to go through each of these (there are a lot!) and check out any I
> want to retain? For the most part, I'd want to overwrite with the new so I
> imagine, given those listed above I'd just need to
>
> git checkout .gitignore
> then git commit ?
>
> Then that presumably gives me an updated dspace-src that I can build and
> deploy as usual with maven and ant?
>
> Sean
> --
>

There's either "git mergetool" for resolving conflicts, or you can use
some GUI tools.

Alternatively, you could have just done a diff (or git diff) of your
changes with the original changed version (e.g. diff -ur
dspace-1.8.2-source/ my-modified-dspace-1.8.2). Then do a fresh
checkout of dspace-3_x and insert only the changes you want to port
manually. Or, if you're feeling up to it, try using patch to automate
it and only resolve the rejected changes (this is s similar workflow
to merging git conflicts). "git am" is the equivalent of "patch" for
patches generated using "git diff", beware that it creates commits,
too. These are just different ways to do the same thing.


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to