1

On my personal project (A Rails app), I forgot to commit whilst working and continued working for many months since. I have changed quite a lot since the last commit and now I wish to get Git all back up and running and to use it properly but Tower is messing up due to it showing 55,000+ files in the Files to stage list. A lot of them seem to be files in directories that I don't want committed (like a node_modules directory) but those have since been deleted but they are still listed. Any action I try to take like stage or unstage or right click a file seems to take ages (as expected with this many I guess). I ahve tried adding certain things to my .gitignore file but they don;t seem to be having any effect.

I've learnt my lesson here and just want my git repo back up and running but need help getting it there.

Any suggestions?

rctneil
  • 7,016
  • 10
  • 40
  • 83
  • .gitignoe seems the way to go. Please show us what you did in the .gitignore. – Joseph K. Strauss Aug 25 '15 at 16:57
  • There are also things you can do, that you will probably need to do, if files or directories are already in the git repo (not just staged). For example: git rm --cached file (this removes a file from git, but leaves the local copy) you can then add it to the .gitignore – gview Aug 28 '15 at 20:14

1 Answers1

1

Two possible solutions.

  1. clone git into a new directory and copy files that you want there and commit from second directory.
  2. Don't stage all files. Instead stage small amount of files you want and commit them. Then do another set of files, etc
pjs
  • 18,696
  • 4
  • 27
  • 56
Arjang
  • 731
  • 1
  • 10
  • 19
  • If I tried option 2. How do I remove from the listing in Tower the files I don;t want. Some of them no longer exist in my project? – rctneil Aug 25 '15 at 17:46
  • git-tower.com is just a flavor of Git. To delete a file, remove it from local then commit and push to master. – Arjang Aug 25 '15 at 18:17
  • Unless there are files that are in master that are not in your local? – Arjang Aug 25 '15 at 18:18
  • I am trying to use option 2 that you suggestion but there as so many files listed that it just errors and gives up. Not sure how to solve this. – rctneil Aug 25 '15 at 18:45
  • I have encounter errors (not sure if it is the same) in very large projects (2GB+) and slow connection to server (VPN). But if developer comes to office and Clone projects in office, after that they are ok. – Arjang Aug 25 '15 at 18:52
  • It's not that. I have 55,000+ files awaiting to be committed and it's having problems allowing me to choose what I want to do with each file. Either stage or unstage! – rctneil Aug 25 '15 at 18:55
  • Yap! That is what i was getting. Slow server and/or network connection and/or big project. Try option 1. – Arjang Aug 25 '15 at 19:29