Re: "Your local changes ... would be overwritten" bug

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: "Your local changes ... would be overwritten" bug

From: Vijay Lakshminarayanan <hidden>
Date: 2016-06-15 22:51:58

Matthieu Moy [off-list ref] writes:
Hannu Koivisto [off-list ref] writes:
quoted
The following script can be used to reproduce the problem:
[...]

I cannot reproduce on Linux.
I can't either.
quoted
I'm running Cygwin git 1.7.5.1 in Windows XP.
I'm running cygwin git 1.7.5.1 in Windows Vista.

$ mkdir temp
d temp
git init
echo foo > testfile
git add testfile
git commit -m "test1"
echo foo > testfile2
chmod +x testfile2
git add testfile2
git commit -m "test2"
mkdir foo
cd foo
git co master~1

vijay@balrog ~/foo
$ cd temp

vijay@balrog ~/foo/temp
$ git init
Initialized empty Git repository in /home/vijay/foo/temp/.git/

vijay@balrog ~/foo/temp
$ echo foo > testfile

vijay@balrog ~/foo/temp
$ git add testfile

vijay@balrog ~/foo/temp
$ git commit -m "test1"
[master (root-commit) 7564449] test1
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 testfile

vijay@balrog ~/foo/temp
$ echo foo > testfile2

vijay@balrog ~/foo/temp
$ chmod +x testfile2

vijay@balrog ~/foo/temp
$ git add testfile2

vijay@balrog ~/foo/temp
$ git commit -m "test2"
[master 9675b55] test2

 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100755 testfile2

vijay@balrog ~/foo/temp
$ mkdir foo

vijay@balrog ~/foo/temp
$ cd foo

vijay@balrog ~/foo/temp/foo
$ git co master~1
git: 'co' is not a git command. See 'git --help'.

Did you mean one of these?
        commit
        clone
        log

vijay@balrog ~/foo/temp/foo
$ git checkout master~1
Note: checking out 'master~1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 7564449... test1
Probably a dumb question (from a non-windows-user), but why not use the
native Git for windows?
Do you mean msysgit?  As a GNU/Linux user, I probably don't need to
explain the luxuries a bash prompt gives you.  In this scenario, cygwin
is the closest approximation on Windows system.

msysgit comes with its own bash shell etc (which is good) but rather
than go that integration route, it's much simpler to have git working
within cygwin when you're already used to it.

Cheers
~vijay

Re: "Your local changes ... would be overwritten" bug

From: Andrew Ardill <hidden>
Date: 2016-06-15 22:51:59

I can not reproduce on msysgit version 1.7.6.msysgit.0, for what it is worth.

Regards,

Andrew Ardill



On 6 September 2011 04:31, Vijay Lakshminarayanan [off-list ref] wrote:
Matthieu Moy [off-list ref] writes:
quoted
Hannu Koivisto [off-list ref] writes:
quoted
The following script can be used to reproduce the problem:
[...]

I cannot reproduce on Linux.
I can't either.
quoted
quoted
I'm running Cygwin git 1.7.5.1 in Windows XP.
I'm running cygwin git 1.7.5.1 in Windows Vista.

$ mkdir temp
d temp
git init
echo foo > testfile
git add testfile
git commit -m "test1"
echo foo > testfile2
chmod +x testfile2
git add testfile2
git commit -m "test2"
mkdir foo
cd foo
git co master~1

vijay@balrog ~/foo
$ cd temp

vijay@balrog ~/foo/temp
$ git init
Initialized empty Git repository in /home/vijay/foo/temp/.git/

vijay@balrog ~/foo/temp
$ echo foo > testfile

vijay@balrog ~/foo/temp
$ git add testfile

vijay@balrog ~/foo/temp
$ git commit -m "test1"
[master (root-commit) 7564449] test1
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 testfile

vijay@balrog ~/foo/temp
$ echo foo > testfile2

vijay@balrog ~/foo/temp
$ chmod +x testfile2

vijay@balrog ~/foo/temp
$ git add testfile2

vijay@balrog ~/foo/temp
$ git commit -m "test2"
[master 9675b55] test2

 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100755 testfile2

vijay@balrog ~/foo/temp
$ mkdir foo

vijay@balrog ~/foo/temp
$ cd foo

vijay@balrog ~/foo/temp/foo
$ git co master~1
git: 'co' is not a git command. See 'git --help'.

Did you mean one of these?
       commit
       clone
       log

vijay@balrog ~/foo/temp/foo
$ git checkout master~1
Note: checking out 'master~1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

 git checkout -b new_branch_name

HEAD is now at 7564449... test1
quoted
Probably a dumb question (from a non-windows-user), but why not use the
native Git for windows?
Do you mean msysgit?  As a GNU/Linux user, I probably don't need to
explain the luxuries a bash prompt gives you.  In this scenario, cygwin
is the closest approximation on Windows system.

msysgit comes with its own bash shell etc (which is good) but rather
than go that integration route, it's much simpler to have git working
within cygwin when you're already used to it.

Cheers
~vijay
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help