Github for Windows not adding new files
Asked Answered
C

2

9

I am using Github for Windows to manage several Git repos. For one of a newly cloned repo, it seems that newly created files appear in the 'X files too be committed' list, but after clicking on the Commit button, a new commit is created but the newly created files are still uncommitted!

enter image description here

I can continue to commit the same files over and over again, creating new commits each time, but the newly created files are simply not committed unless I go to the command prompt and manually do git add .

Is there a setting in Github for Windows that I have missed?

Chippy answered 8/6, 2013 at 15:20 Comment(5)
Did you ever fix this? I'm in the same boat.Tuneless
@BrianOrtiz Nope :( This sucksChippy
I've sent GitHub an email about this and linked this SO question in my description of the bug.Fungosity
I did the same some time ago and that's part of the answer I got: "It's a known issue that will be fixed shortly (we just need to ship GitHub for Windows with the updates LibGit2Sharp library). You can see the related issue here: github.com/libgit2/libgit2/issues/1766". So they know about it and how to fix it, but haven't done so yet.Fellmonger
Till today (09-Aug-2016), this issue page is 404 and the problem persists.Macneil
V
6

Actually I don't think you are missing anything. I just tested this and this is not the default behaviour. Normally after you commit, the files should be flagged as unsynced. When you click Sync button the committed changes should be pushed to the upstream.

This is most probably a bug.

Before commit:

Before commit

After commit :

After commit

Viosterol answered 8/6, 2013 at 16:10 Comment(2)
Hope the bug gets fixed soon!Chippy
Not fixed yet :/ I'll see if there is an issue.Fellmonger
A
1

Best I can tell, GitHub for Windows doesn't properly recognize file differences that only vary by line endings (at least in the scenarios I've found). I had multiple javascript files that consisted of something like:

- (function(){
-   function foo(){
-     return 'bar';
-   }
- )();
+ (function(){
+   function foo(){
+     return 'bar';
+   }
+ )();

Which, at first glance didn't make sense. Then, after I looked in to it, the variance was the file went from a \r\n line ending to \n (or the inverse). FWIW, I have the following setup in .gitattributes:

* text=auto

However, I was able to resolve it by using the shell. First, a git status showed me I did, indeed, have several files with modifications (and git even told me they varied by line endings):

.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Project/Path/file.js

then, i used git commit -a to add those files, and finally git push to send them up to the repository. I now (even according to GitHub for Windows) have a syncd branch.

Alameda answered 25/7, 2013 at 20:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.