0

I'm really new on git, and things are really complicated. I really need all of your help!

I don't know where is the mistake so I will tell my all story from the beginning. I was working on another computer, and were able to push without an issue. Then I changed to my current computer, so download from the web (which is visual studio btw) my project, directly with the download button. Then I start working on my new project. Yesterday, I tried pushed and it told me "Everything is up-to-date". Thought, didn't accept my push. I just nevermind yesterday and continue working. Today, I tried pushing again but I figured out I didn't commit yet. So from XCode, from to top bar I go for commit and then opened the terminal again. Tried to push one more time, but here my problem is started. Because of I was working cocoapods, I was working from .xcworkspace. With the push, I am now not able to open my project. It started giving me error "Workspace Integrity(Couldn't load project). Tried re-opening several times, but ofc, didn't work. So, I still assume that is because of the push and if I handle the push problem that will also fixed. To be able to push, I found that I need to pull then push. So I tried to pull, but that also gave me the error of being unmerged files. Then, I decided to figure out a way to merge, but those I found on the net, especially on stack, there are nothing worked for me.

Things are complicated for me then you thought, because I really don't know what is git at all and it just came up with all of these error. There are lots of errors and I'm really confused.

I really need someone to help me deeply, at least telling me a way to out.

Hope that long story don't scare you, as I am scared too.

Thanks from now,

Waiting for your guidance, desperately!

Kutay Demireren
  • 640
  • 1
  • 10
  • 25

1 Answers1

1

You should try issuing a git fetch, and then a git merge from the terminal. This is usually a better way than to use git pull. git status is your best friend too, it will show any files that have not been added to your staging area. If you have files that have not been added yet, you can either run a git add <filenames> or you can commit and add at the same time with

git commit -a -m "commit message"

Hope this helps at least a little.

Also, you definitely don't want to corrupt your remote repo, so don't push your local repo if it's bad. If your remote repo is still okay, you can clone it again, and add the changes that you made yesterday and today manually, not ideal, but it might be your only choice if you can't open your files.

TheHuman Wall
  • 207
  • 1
  • 8
  • Opened terminal, navigated to root directory, and used git fetch , it didn't return me anything. Something normal ? – Kutay Demireren Jul 10 '15 at 14:43
  • so you went to your project directory? – TheHuman Wall Jul 10 '15 at 14:45
  • I would check to see if your remote repo is still okay, you can clone it into a new directory, try to open it, if you can't open it, i.e. same error, you are going to have to roll back to an older version of the code and work forward from there – TheHuman Wall Jul 10 '15 at 14:48
  • Should I copy whole the director file ? I mean including pods, .wcworkspace etc. Or just the files that has .m .h and storyboard – Kutay Demireren Jul 10 '15 at 14:51
  • Okay that was not a good question haha sorry I'm really confused. I copied and I can't open that copied project without an issue – Kutay Demireren Jul 10 '15 at 14:52
  • lol it's okay, you should just run a 'git clone' command on your remote repository... so if you're hosting it on github, you would go there, copy the http://... address, make some arbitrary directory in your terminal 'mkdir arbitrary', cd into that, and run 'git clone http://github.com/...' – TheHuman Wall Jul 10 '15 at 14:55
  • It's opening. I finally figured it how to do this :) – Kutay Demireren Jul 10 '15 at 15:27
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/82971/discussion-between-kutay-demireren-and-thehuman-wall). – Kutay Demireren Jul 10 '15 at 15:27