Reputation: 40747
Ok, I think I've screwed things up, I am working on a project and using git as version control:
I think I screwed up somewhere along the lines and now when I say git status I get:
# Not currently on any branch.
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: Cocina/bin/Debug/Cocina.exe
# modified: Cocina/bin/Debug/Cocina.pdb
# modified: Cocina/obj/x86/Debug/Cocina.exe
# modified: Cocina/obj/x86/Debug/Cocina.pdb
# modified: Viernes 7.suo
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# Cocina/Info.cs
# Cocina/bin/Debug/Cocina.vshost.exe.manifest
# Viernes 7/Properties/DataSources/
# Viernes 7/Table.cs
# Viernes 7/bin/Debug/Viernes 7.vshost.exe.manifest
# Viernes 7/obj/x86/Debug/ResolveAssemblyReference.cache
# back/
# tables/
no changes added to commit (use "git add" and/or "git commit -a")
I have everything I did [here][1], but it's a quite long, but maybe it help out.
The only thing I know for a fact is that in this commit I am sure everything is working as I wanted, and them everything started going south with the merges...
PS C:\Users\Trufa\Documents\Visual Studio 2010\Projects\Viernes 7> git commit -am "the lisview now saves indexes of allr
eady clicks and deletes when table closes"
Can I go back and check how the files where at that moment?
Sorry to the answerers I lost my Internet connexion right after I posted the question!
So UPDATE:
I had a copy of git gui from github that helped me visualize what the different commits.
There was some kind of a conflict with the .exe 's and it prevented me from doing more or less anything I couldn't merge and I couldn't commit and I couldn't check out so what I did was copied my non working but correct commit and put in into another project in the same solution.
So the question is what should I do now?
I would be happy to "start" over, I mean at this point the project is working as it should so I would like to commit it, so now, what should I do?
I guess the whole problem was for not using a complete gitignore file, what happens if I add it now?
So my question is what should I do now, I'm kind of afraid of braking things because I'm on a hurry, what is the simplest solution of all? Is it a big overkill to start the git repo from scratch, delete the git and start over from this point since It's working?
I know this sounds a little bit mediocre but I don't have much time so I really don't want to be playing around learning about git, I'll have time for that later, now I want an easy fix.
Upvotes: 1
Views: 1234
Reputation: 19950
I see two problems with your log:
You should not place generated files like *.exe into your repo, since these files cause trouble when you want to merge diverged development lines.
Also you have another problem, since you can't overwrite these files when they are open, so you need to close the running programs to overwrite *.exe files, and close visual studio to overwrite *.sou and *.pdb.
See .gitignore for Visual Studio Projects and Solutions for things better left out.
On line 232 you checked out a revision by its SHA1, which placed you in the so called detached head
state. This means, that when you commit something atop of this commit, and check out some other branch, you will have a hard time to get back to the just created commit. See http://marklodato.github.com/visual-git-guide/index-en.html#detached for more details.
Upvotes: 2
Reputation: 21698
First of all, you can see a log of all your commits:
$ git log --online
(--online is not mandatory, but makes output less verbose). Output will be something like:
1fb3915 Fixed View page.
3f69344 Added new images.
d2f74d8 Fixed css.
0e516db Added some photos.
5b99592 Added all cart pages.
If d2f74d8 is the commit where everything was working. Just type:
$ git checkout d2f74d8
Now you can re-start from here. You just want to copy here some code and paste it in master? Copy code and type
$ git checkout master
You want to re-start to code from here? I suggest you to create a new branch:
$ git checkout -b new-branch-name
Make here your stuff. And when you are ready, you can merge code with your branch:
$ git checkout master
$ git merge new-branch-name
Upvotes: 0
Reputation: 21365
mm You are not in a branch in your Git folder. I think nothing wrong has happened to your files.
Have you tried?
$ git branch --> will list all your branches
This should list at least your master branch
$ git checkout master --> this will switch to master and you will be able to commit files again
Upvotes: 1