Re: [git-users] Beginner stuck in a commit

2012-08-07 Thread Philip Oakley

  - Original Message - 
  From: Jeffery Brewer 
  To: git-users@googlegroups.com 
  Sent: Tuesday, August 07, 2012 3:57 AM
  Subject: [git-users] Beginner stuck in a commit


  I've slowly been trying to get git to work and just running into loads of 
problems.

  Using the windows bash I just tried to do a commit this evening and forgot to 
add a message (e.g. -m my work for today) and sent the bash into some sort of 
odd editing mode that I can't seem to get out of. I finally just closed the 
bash and opened a new bash and tried to commit and got all kinds of error 
messages with a prompt to type (R) to recover. Typed R to recover and it took 
me right back into the strange editing mode that I can't seem to get out of 
now. I've backed up all the files in the directory (sensing an impending 
catastrophe) but not sure what else to do at this point to get git running 
again. 

  Any help would be appreciated.
Others have mentioned that you are in one of those unfathomable Unix terminal 
editors ;-) Assuming/If you are on Windows...

I'd suggest that you set up your configuration to use Notepad++ (a lovely open 
source editor). There is a Stackoverflow page with details.
Set up your .gitconfig (mine's in C:\Documents and Settings\Philip\.gitconfig) 
as 

[core]
 editor = 'C:\\Program Files\\Notepad++\\notepad++.exe' -multiInst -notabbar 
-nosession -noplugin

  More detail...

  If I open a new bash in the directory and run git commit I'm getting this 
error message:

  E325: ATTENTION
  Found a swap file by the name .git\.COMMIT_EDITMSG.swp
   dated: Mon Aug 06 19:45:14 2012
   file name: 
C:/Users/me/Documents/NetBeansProjects/foldername/.git/COMMIT_EDITMSG
modified: YES
   user name: me   host name: my computer
  process ID: 10368
  While opening file .git\COMMIT_EDITMSG
   dated: Mon Aug 06 19:55:29 2012
NEWER than swap file!
  (1) Another program may be editing the same file.
  If this is the case, be careful not to end up with two
  different instances of the same file when making changes.
  Quit, or continue with caution.
  (2) An edit session for this file crashed.
  If this is the case, use :recover or vim -r .git\COMMIT_EDITMSG
  to recover the changes (see :help recovery).
  If you did this already, delete the swap file .git\.COMMIT_EDITMSG.swp
  to avoid this message.
  Swap file .git\.COMMIT_EDITMSG.swp already exists!
  -- More -- SPACE/d/j: screen/page/line down, b/u/k: up, q: quit

  -- 
  You received this message because you are subscribed to the Google Groups 
Git for human beings group.
  To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/XE0-ivLyDtAJ.
  To post to this group, send email to git-users@googlegroups.com.
  To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

  No virus found in this message.
  Checked by AVG - www.avg.com
  Version: 2012.0.2197 / Virus Database: 2437/5181 - Release Date: 08/06/12

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: could not lock file gitconfig: permission denied

2012-08-07 Thread coccinelle
I restarted Git Bash (I see, it is necessary). Git doesn't complain any 
more, but does not write in the file where it looks later.
After playing around with, I have now 3 config files: C:\Program 
Files\Git\etc\gitconfig, and two in my home directory: gitconfig and 
.gitconfig (with and without dot in the beginning). The latter one appeared 
at some point, when I was setting HOME manually to my home drive.
I edited the user information in all three files manually. Git seems to 
look only in C:\Program Files\Git\etc\gitconfig . If the information is in 
this file, everything is fine. If not, I get the message tell me who you 
are, independently of the information in the other files.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/05FwUimPs4UJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: could not lock file gitconfig: permission denied

2012-08-07 Thread Thomas Ferris Nicolaisen
On Tuesday, August 7, 2012 5:01:50 PM UTC+2, coccinelle wrote:

 I restarted Git Bash (I see, it is necessary). Git doesn't complain any 
 more, but does not write in the file where it looks later.
 After playing around with, I have now 3 config files: C:\Program 
 Files\Git\etc\gitconfig, and two in my home directory: gitconfig and 
 .gitconfig (with and without dot in the beginning). The latter one 
 appeared at some point, when I was setting HOME manually to my home drive.
 I edited the user information in all three files manually. Git seems to 
 look only in C:\Program Files\Git\etc\gitconfig . If the information is 
 in this file, everything is fine. If not, I get the message tell me who 
 you are, independently of the information in the other files.


I would find it very odd if Git creates the .gitconfig file without using 
it thereafter.

You should retrace your steps to see with under which exact settings the 
.gitconfig gets created in your home-dir, and then, using git config -l, 
see if changes in the .gitconfig file in your home-dir has any effect. 

Keep in mind that git config -l will output the *sum *of configuration 
entries, including both the ones in home-dir and in etc/gitconfig.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/ii2k9o9CyIUJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: could not lock file gitconfig: permission denied

2012-08-07 Thread coccinelle
Here the different cases I tried:

1.) changing the initial line HOME=$HOMEDRIVE$HOMEPATH to 
HOME=$USERPROFILE.
Creates .gitconfig when I call git config --global user.name Name. This 
file contains only the user (name, email) information. Changes are seen by 
-l.
Commit fails with tell me who you are.

2.) changing the initial line HOME=$HOMEDRIVE$HOMEPATH to HOME = 
C:/Documents and Settings/me/.
Same behaviour as in 1.)

3) adding a line HOME = C:/Documents and Settings/mbader/ after the 
complete section where home is defined.
Git Bash start with an error message HOME command not found, but I can 
use it.
Git behaves later as if this line is not existing.


git config -l sees changes in .gitconfig and in C:\Program 
Files\Git\etc\gitconfig, but not in C:\Documents and Settings\me\gitconfig.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/Z9noTS_-0oIJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Beginner stuck in a commit

2012-08-07 Thread Jeffery Brewer
Thanks very much for all the help. I'm going to play around with this 
tomorrow when I get back on the computer all that is on.

On Tuesday, August 7, 2012 8:46:07 AM UTC-7, Peter J Weisberg wrote:

 On Mon, Aug 6, 2012 at 9:03 PM, Daniel P. Wright  wrote:
  The default editor for git is vim, which is a sensible choice as its
  available on nearly every platform, but if you've never encountered it
  before it can seem a little... unusual.

 I'm not sure a text-editor is sensible if a newbie *can't figure out 
 what it is*.  The only reason to make it the default IMO is that it 
 *is*available on every system (except Windows).  On Windows, I think a 
 sensible 
 default would be Wordpad.  Of course, no one asked me my opinion. :-)

 P.S.: Here's the minimum you need to know about vim:

 It starts in command mode
 To enter text, you need to be in insert mode
 Switch from command mode to insert mode by pressing i
 Switch from insert mode to command mode by pressing ESC
 In command mode:
 save by typing :w
 quit by typing :q
 save and quit by typing :wq
 quit without saving by typing :q!

 -PJ

 Gehm's Corollary to Clark's Law: Any technology distinguishable from
 magic is insufficiently advanced. 

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/A2PMxmLnIJoJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Checking out files into existing directory

2012-08-07 Thread Jeffery Brewer
I swear I'm going to figure out how to work with git at some point and stop 
bothering everyone with these stupid beginner problems!

So here's my current problem. I'm trying to checkout (not sure if that's 
the right term or not) files from my repository into an existing folder (a 
folder created as a NetBeans project...something NetBeans recognizes as a 
project folder). Clone doesn't work...tells me there is existing content. 
When I deleted all the content and cloned it again, it put all the contents 
into a sub-folder. So I tried using fetch. When I fetched, it took a very 
long time and looked like it was doing work (it was showing me some kind of 
progress), but when it got all done the folder was empty. I tried this a 
couple of times and then tried pull, which did the same thing. At one point 
after a fetch I typed git status and got a long message saying all my 
files were deleted. Finally after searching around for clues decided to 
clone into a separate directory then copy and paste all the contents of 
that directory back over to my project directory. 

I guess my question is, how do I get my files out of the repository and 
into an existing folder on my computer? And why doesn't fetch or pull 
actually fetch or pull any files down from the repository?

Thanks,

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/-JtXABcSozYJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] fast-import error: fatal: 'refs/heads/master' - not a valid ref

2012-08-07 Thread Konstantin Khomoutov
On Tue, Aug 07, 2012 at 01:24:31PM -0700, Andrey Pavlenko wrote:

 I'm developing a remote helper which uses the fast-import stream for 
 fetching. When I perform cloning git prints error message - fatal: 
 'refs/heads/master' - not a valid ref, however the clonning completes 
 normally. Each my fast-import commit command starts with 
 commit refs/heads/master header.
 
 What does this error message mean and how can I fix it?

Please address this question to the developers' Git list instead,
which is git at vger.kernel.org.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] git clone fails with unable to overwrite old ref-pack file

2012-08-07 Thread Lisa Zorn
Hello,
I have been using git for years and have not run into this problem before. 
 I tried to git clone a repo that's on a local drive, and I get this error:
dir1\dir2git clone -b master Y:\git_src
Cloning into 'Muni_GenevaBRT_HuntersPtToCandlestickInterchangeOnly'...
done.
fatal: unable to overwrite old ref-pack file: Permission denied
fatal: The remote end hung up unexpectedly

However, when I run it in another directory (not a subdir of dir1), it 
works fine.  But it's repeatable; if I run it from dir1\dirX it happens 
again.
I am using the stable version of git, and I'm on windows.  What's going on 
with the old ref-pack file?

Thanks!
-Lisa

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/plrGfYp4gNkJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git clone fails with unable to overwrite old ref-pack file

2012-08-07 Thread Wes Freeman
Check your permissions on dir1, and make sure it's not set as read-only or
something.

Wes

On Tue, Aug 7, 2012 at 9:24 PM, Lisa Zorn lisa.z...@sfcta.org wrote:

 Hello,
 I have been using git for years and have not run into this problem before.
  I tried to git clone a repo that's on a local drive, and I get this error:
 dir1\dir2git clone -b master Y:\git_src
 Cloning into 'Muni_GenevaBRT_HuntersPtToCandlestickInterchangeOnly'...
 done.
 fatal: unable to overwrite old ref-pack file: Permission denied
 fatal: The remote end hung up unexpectedly

 However, when I run it in another directory (not a subdir of dir1), it
 works fine.  But it's repeatable; if I run it from dir1\dirX it happens
 again.
 I am using the stable version of git, and I'm on windows.  What's going on
 with the old ref-pack file?

 Thanks!
 -Lisa

 --
 You received this message because you are subscribed to the Google Groups
 Git for human beings group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/git-users/-/plrGfYp4gNkJ.
 To post to this group, send email to git-users@googlegroups.com.
 To unsubscribe from this group, send email to
 git-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/git-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git clone fails with unable to overwrite old ref-pack file

2012-08-07 Thread Lisa Zorn
Thanks, I tried making sure I set things to not RO but I'll try more 
(windows permissions are confusing, I am never sure if I'm succeeding with 
things using the UI).
The other thing is that before this, we git clone many other things into dir2 
and they all work fine, but this one fails.
And it's re-producable; if I delete dir2 and start over, the same thing 
happens on the same git_src (ok clearly that's Muni_GenevaBRT_
HuntersPtToCandlestickInterchangeOnly but I was trying to simplify my email)
 after succeeding with other git clones before that).
-Lisa

On Tuesday, August 7, 2012 6:37:34 PM UTC-7, Wes Freeman wrote:

 Check your permissions on dir1, and make sure it's not set as read-only or 
 something.

 Wes

 On Tue, Aug 7, 2012 at 9:24 PM, Lisa Zorn lisa...@sfcta.org javascript:
  wrote:

 Hello,
 I have been using git for years and have not run into this problem 
 before.  I tried to git clone a repo that's on a local drive, and I get 
 this error:
 dir1\dir2git clone -b master Y:\git_src
 Cloning into 'Muni_GenevaBRT_HuntersPtToCandlestickInterchangeOnly'...
 done.
 fatal: unable to overwrite old ref-pack file: Permission denied
 fatal: The remote end hung up unexpectedly

 However, when I run it in another directory (not a subdir of dir1), it 
 works fine.  But it's repeatable; if I run it from dir1\dirX it happens 
 again.
 I am using the stable version of git, and I'm on windows.  What's going 
 on with the old ref-pack file?

 Thanks!
 -Lisa

 -- 
 You received this message because you are subscribed to the Google Groups 
 Git for human beings group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/git-users/-/plrGfYp4gNkJ.
 To post to this group, send email to git-...@googlegroups.comjavascript:
 .
 To unsubscribe from this group, send email to 
 git-users+...@googlegroups.com javascript:.
 For more options, visit this group at 
 http://groups.google.com/group/git-users?hl=en.




-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/MCq1e6ocdQMJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Checking out files into existing directory

2012-08-07 Thread Daniel P. Wright
Jeffery Brewer (Tue, Aug 07, 2012 at 11:54:16AM -0700) 
 So here's my current problem. I'm trying to checkout (not sure if that's 
 the right term or not) files from my repository into an existing folder (a 

Try to be careful with terminology.  It's made more confusing by the
fact that the same terms mean different things in different version
control systems, but in git checkout means, Update files in the
working tree to match the version in the index or the specified
tree[1], where the specified tree is usually a commit or branch ID.

Also, always bear in mind that in a DVCS like git *every clone* is a
repository.  So when you say my repository -- which repository do you
mean?  Do you mean a repository you've created on your local machine, a
repository you've cloned locally, or some central repository on a
server somewhere (say, github)?

If it is a local repository, it would be usual for there already to be a
working tree of the files checked out (unless you'd created a bare
repository which you are unlikely to have done accidentally).

 folder created as a NetBeans project...something NetBeans recognizes as a 
 project folder). Clone doesn't work...tells me there is existing content. 

Please describe what is the state of the repository and your working
folders and what it is you are trying to achieve (what state you are
trying to get them into).

It sounds as if you have a set of source files in a repository on a
server somewhere, and a folder locally-created by NetBeans with no
source but some sort of project files which NetBeans uses.  Assuming
this is the case, here is one approach.  In the following sequence of
commands, $ represents the prompt, so shouldn't be copied.  Anything
without a $ represents the likely output, so obviously you don't copy
that either.  You should start in the parent folder of the netbeans
project.  Obviously you would need to replace the repository address
with your own.  Also I know nothing about NetBeans so I just pretended
for the sake of example that your netbeans project folder contains a
single file, project.netbeans.  Hopefully all will become clear...

  $ ls
  netbeans_project
  $ git clone g...@github.com:username/project.git
  Cloning into 'project'...
  remote: Counting objects: 20, done.
  remote: Compressing objects: 100% (16/16), done.
  remote: Total 20 (delta 5), reused 19 (delta 4)
  Receiving objects: 100% (20/20), 16.21 KiB, done.
  Resolving deltas: 100% (5/5), done.
  $ ls
  netbeans_project project
  $ cp -rf netbeans_project/* project
  $ rm -rf netbeans_project
  $ cd project
  $ git status
  # On branch master
  # Untracked files:
  #   (use git add file... to include in what will be committed)
  #
  #   project.netbeans
  nothing added to commit but untracked files present (use git add to track)
  $ git add .
  $ git commit -m Added NetBeans project files
  $ git push

In the above sequence, I first clone the project into a local directory,
outside of the netbeans_project directory.  I then copy the entire
contents of the netbeans_project directory into my local clone, and
delete the old version.  Changing into the project directory, I confirm
the presence of the netbeans project file with git status.  I then add
and commit them as usual.

Note that git add . will add all files in the current folder and all
subfolders.  You may want to be more selective about which files you
add!  Look at the output of git status and add only those files which
you want in the repository.

Also be very careful with rm -rf.  This will delete all files in the
directory specified and all subdirectories, without any kind of
confirmation dialogue to make sure it's ok.

 When I deleted all the content and cloned it again, it put all the contents 
 into a sub-folder. So I tried using fetch. When I fetched, it took a very 
 long time and looked like it was doing work (it was showing me some kind of 
 progress), but when it got all done the folder was empty. I tried this a 
 couple of times and then tried pull, which did the same thing. At one point 
 after a fetch I typed git status and got a long message saying all my 
 files were deleted. Finally after searching around for clues decided to 
 clone into a separate directory then copy and paste all the contents of 
 that directory back over to my project directory. 

When describing problems like these, it is always better to provide a
log of exactly the commands you typed and their output than to try and
describe it in English.  You can simply copy and paste the contents of
your command prompt window.

 
 I guess my question is, how do I get my files out of the repository and 
 into an existing folder on my computer? And why doesn't fetch or pull 
 actually fetch or pull any files down from the repository?

git fetch will fetch the contents of the remote repository into the
local repository (remember your local clone is a full repository!), but
will not merge those files with any of your local branches or check 

Re: [git-users] git clone fails with unable to overwrite old ref-pack file

2012-08-07 Thread Wes Freeman
I agree, windows permissions are annoying. Actually it might be a
permission within the git_src folder getting copied down. Have you looked
at that?

Wes

On Tue, Aug 7, 2012 at 9:43 PM, Lisa Zorn lisa.z...@sfcta.org wrote:

 Thanks, I tried making sure I set things to not RO but I'll try more
 (windows permissions are confusing, I am never sure if I'm succeeding with
 things using the UI).
 The other thing is that before this, we git clone many other things into dir2
 and they all work fine, but this one fails.
 And it's re-producable; if I delete dir2 and start over, the same thing
 happens on the same git_src (ok clearly that's Muni_GenevaBRT_**
 HuntersPtToCandlestickIntercha**ngeOnly but I was trying to simplify my
 email) after succeeding with other git clones before that).
 -Lisa


 On Tuesday, August 7, 2012 6:37:34 PM UTC-7, Wes Freeman wrote:

 Check your permissions on dir1, and make sure it's not set as read-only
 or something.

 Wes

 On Tue, Aug 7, 2012 at 9:24 PM, Lisa Zorn lisa...@sfcta.org wrote:

 Hello,
 I have been using git for years and have not run into this problem
 before.  I tried to git clone a repo that's on a local drive, and I get
 this error:
 dir1\dir2git clone -b master Y:\git_src
 Cloning into 'Muni_GenevaBRT_**HuntersPtToCandlestickIntercha**
 ngeOnly'...
 done.
 fatal: unable to overwrite old ref-pack file: Permission denied
 fatal: The remote end hung up unexpectedly

 However, when I run it in another directory (not a subdir of dir1), it
 works fine.  But it's repeatable; if I run it from dir1\dirX it happens
 again.
 I am using the stable version of git, and I'm on windows.  What's going
 on with the old ref-pack file?

 Thanks!
 -Lisa

 --
 You received this message because you are subscribed to the Google
 Groups Git for human beings group.
 To view this discussion on the web visit https://groups.google.com/d/**
 msg/git-users/-/plrGfYp4gNkJhttps://groups.google.com/d/msg/git-users/-/plrGfYp4gNkJ
 .
 To post to this group, send email to git-...@googlegroups.com.
 To unsubscribe from this group, send email to git-users+...@**
 googlegroups.com.

 For more options, visit this group at http://groups.google.com/**
 group/git-users?hl=en http://groups.google.com/group/git-users?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Git for human beings group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/git-users/-/MCq1e6ocdQMJ.

 To post to this group, send email to git-users@googlegroups.com.
 To unsubscribe from this group, send email to
 git-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/git-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.