Question

I am pretty new to git but enjoy it already. Here is my current issue:

  • some info:
    • I am extending a project that a friend gave me as an archive. The folder contained the git repository and had an origin on github.
    • after cleaning unnecessary stuff I made an account on BitBucket and pushed the entire project there and untracked from the origin
    • I kept working nicely: made branches, commits, merging, everything went fine. For a month I started working on a branch and change a few files (around 20 I think). Everything seemed fine.
  • the problem:
    • a few days ago, I decided to move the project folder from one partition to another (I work on a Macbook and I moved it from the Windows partition to MacOS's partition)
    • when git status'ed, I noticed that all the files in my project were considered modified, not only my current changes. Now I don't know what my changes are and the branch is useless. What can I do to see only my changes? I haven't touched most part of the project and the entire history is fine.
Was it helpful?

Solution 2

you can use the command

git diff

to see changes for all files, or

git diff filename

to see the changes for a specific file. Most probably the permissions of your files have changed. So you'll have to see if those changes will be necessary for your future work or not... seeing the differences might help you doing some cleanup. If you want to revert some of the changes you can do

git checkout filename

to remove unnecessary modifications

OTHER TIPS

The issue when moving a repo is mostly due to the changed file mode. So for your repo, you can run

git config core.filemode false

then when you do a new

git status

now you should not be seeing so many changed files. If you moved many repos below command will make more sense to change the global git behaviour for the current user.

git config --global core.fileMode false

please see this answer for more information about changed mode settings and git :

https://stackoverflow.com/a/1580644/2815227

You can use:

git checkout -- .

And try this:

git config core.filemode false
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top