Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git clone -> Changes not staged for commit #9492

Closed
dhoko opened this issue Jan 11, 2016 · 13 comments
Closed

Git clone -> Changes not staged for commit #9492

dhoko opened this issue Jan 11, 2016 · 13 comments
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.

Comments

@dhoko
Copy link

dhoko commented Jan 11, 2016

screenshot from 2016-01-11 11 28 27

Hi,
After a git clone I've got some some Changes not staged for commit :/

$ myOS 
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty
$ git config --list
user.name=dhoko
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@github.com:piwik/piwik.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
@tsteur
Copy link
Member

tsteur commented Jan 11, 2016

what does it show when you do a git diff?

@dhoko
Copy link
Author

dhoko commented Jan 12, 2016

git diff

errors:

$ git diff > ../diffpiwik.log
warning: CRLF will be replaced by LF in libs/bower_components/jquery.scrollTo/README.md.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in libs/bower_components/jquery.scrollTo/jquery.scrollTo.min.js.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in libs/bower_components/jquery.scrollTo/scrollTo.jquery.json.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in libs/pChart/GPLv3.txt.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in libs/pChart/class/pData.class.php.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in libs/pChart/class/pDraw.class.php.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in libs/pChart/class/pImage.class.php.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in libs/pChart/class/pPie.class.php.
The file will have its original line endings in your working directory.

@tsteur
Copy link
Member

tsteur commented Jan 12, 2016

Looks like the files have windows line endings which we could change to Linux endings. I couldn't reproduce it though:

git config --list
user.email=yyy
user.name=yyy
filter.lfs.clean=git-lfs clean %f
filter.lfs.smudge=git-lfs smudge %f
filter.lfs.required=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@github.com:piwik/piwik.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

These changes could be ignored with core.autocrlf but that's not a solution. Can someone else reproduce it?

@evifere
Copy link

evifere commented Jan 13, 2016

me too on Debian GNU/Linux 8.2 jessie
screenshot_084

@mattab
Copy link
Member

mattab commented Feb 2, 2016

maybe try git config --global core.autocrlf input source: https://help.github.com/articles/dealing-with-line-endings/

@dhoko
Copy link
Author

dhoko commented Feb 10, 2016

It works \o/ Merci !

@dhoko
Copy link
Author

dhoko commented Feb 24, 2016

It works with this repository but does not with mine :/
Should I create a new fork ?

Cannot stash changes :/

The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in plugins/DevicesDetection/images/brand/iBerry.ico.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in plugins/DevicesDetection/images/brand/teXet.ico.
The file will have its original line endings in your working directory.

@mattab
Copy link
Member

mattab commented Mar 15, 2016

@dhoko I'm not sure what the problem is. feel free to create new fork if it helps 👍

@mattab mattab modified the milestones: 2.16.x (LTS), Mid term Mar 31, 2016
@mattab
Copy link
Member

mattab commented May 23, 2016

Here is a solution:

# important:    Save  / commit your current files in Git, so that none of your work is lost.

#    Remove every file from Git's index.
    git rm --cached -r .

#    Rewrite the Git index to pick up all the new line endings.
    git reset --hard

EDIT: and another one simpler?

git checkout --force master

@jurgenhaas
Copy link

This is still a problem when you clone 2.16.2, these files have the wrong line endings:

libs/bower_components/jquery.scrollTo/README.md
libs/bower_components/jquery.scrollTo/jquery.scrollTo.min.js
libs/bower_components/jquery.scrollTo/scrollTo.jquery.json
libs/pChart/GPLv3.txt
libs/pChart/class/pDraw.class.php
tests/UI/expected-ui-screenshots 

tsteur added a commit to matomo-org/developer-documentation that referenced this issue Aug 29, 2016
@Findus23
Copy link
Member

All CRLF fileendings should have been replaced since in #11869, so the error shouldn't occur anymore.

@Findus23 Findus23 added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Aug 25, 2018
@ravindrapankaj
Copy link

I think you need to run:
git add '.' (period/dot without quotes) or name of your modified file
and then
git commit -m "Your Message"

@aashutosh19
Copy link

aashutosh19 commented Sep 12, 2019

git pull --allowed-unstaged-changes will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

8 participants