Re: [git-users] File in master messed up after adding someone's topic

2014-01-04 Thread Philip Oakley
The problem, if you haven't already realised, is that when git started the 
second step of the pull - the merge step - it was 'mixing together' your local 
version and the fetched version, and having noticed the conflicts, then left 
your working directory in that 'dirty' state for you to resolve (i.e fix).

The usual response is to use 'git reset --hard' to throw away any changes. 
Given that you said that you don't do any changes this is a reasonable thing to 
do as it would make the directory clean again. However it is a big gun, and in 
fact you don't want to go back to what you had before, rather you want to go 
forward to use what you fectched from the upstream.

So first do the 'git branch -f master origin/master' to force your master to 
think it is identical to origin/master (assuming origin is your remote's name, 
and it is their master branch you fetch). No you can use 'git reset --hard' to 
make your worktree clean relative to your updated ref for master and 
origin/master. 

also have a look at http://git-scm.com/blog on reset demystified.

'git reset --hard' will assume the use of HEAD which is the current branch.

You can also shortcut this process via 'git reset --hard origin/master' 
(assuming you are on master branch) see 
http://stackoverflow.com/questions/15432052/what-is-the-meaning-of-git-reset-hard-origin-master
 and https://www.kernel.org/pub/software/scm/git/docs/git-reset.html 

Philip
  - Original Message - 
  From: nmac...@iburst.co.za 
  To: git-users@googlegroups.com 
  Cc: nmac...@iburst.co.za ; Philip Oakley 
  Sent: Saturday, January 04, 2014 2:38 AM
  Subject: Re: [git-users] File in master messed up after adding someone's topic




  On Friday, January 3, 2014 6:27:21 PM UTC+2, Philip Oakley wrote:
First, don't panic. Nothing is lost.

It sound like the 'pull' workflow you are using, does not match the work 
style of the upstream project.

  Having removed the topic, I only have one branch - master. Somehow, the 
problem file is the version from the topic, not the version in master at 
Gitorious.
  Using Windows 7, mysysgit 1.81. My path includes C:\PROGS\Programming\Git\cmd 
where gitk.cmd is.
  If I run gitk I get an error message - see attachment.
  But gitk should be irrelevant as I only have one branch - master. It is just 
that somehow I need to get git happy with the correct version of this file.




Then do a 'gitk --all' to view all the different branches and their 
locations, and then do the update you need.
  Aye, therein lies the rub!! I get told to either stash or commit. Stash 
doesn't help because I have not made local changes (git did it for me) and I 
tried a commit with the comment Ignore/Delete - Fixing file conflict. Also 
didn't help.







- Original Message - 
  From: nma...@iburst.co.za 
  To: git-...@googlegroups.com 
  Sent: Thursday, January 02, 2014 4:42 AM
  Subject: [git-users] File in master messed up after adding someone's topic


  I just use git to keep up with bleeding edge changes to a project. Don't 
edit/commit or anything.
  Added someone's topic to get their files for review.
  Then removed the topic.
  However, one file in master was changed by adding the topic. (I didn't 
touch it.)
  Now I can no longer do a pull because it reports a merge conflict.
  I can access the latest version of that file (master version), and use 
copy and paste, but of course git then says I have edited the file and I must 
either stash or commit. 
  Stashing reverts me to the incorrect version of the file.
  What can I do? Short of starting from scratch - the repository is about 
5GB - 12 hours download.


  -- 
  You received this message because you are subscribed to the Google Groups 
Git for human beings group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.


  -- 
  You received this message because you are subscribed to the Google Groups 
Git for human beings group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] File in master messed up after adding someone's topic

2014-01-04 Thread nmackay
A couple of points:
1) Because of bandwidth constraints at the time, I didn't do a clone, I did 
a shallow pull when I started. Not important at the time as I only do pulls.
2) So my system is unaware of origin.
3) The branch is master,
4) In another folder I work with a different repository.
5) Is git config relevant to each folder/repository, or is it system-wide?
6) Because config is not set-up correctly, I have to use git fetch 
git://gitorious.org/fg/fgdata.

Having attended to the above, I may then be able to do
git fetch
git reset --hard origin/master.

Thanks for all the help so far. Pity about the time-zones making the 
turnaround time so long.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] File in master messed up after adding someone's topic

2014-01-04 Thread nmackay
Fixed my origin value and then did reset --hard origin.master and 
everything works now.
This thread has been added to Favourites.
Much obliged for all the help.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.