3
I’m starting to get into GIT. And a problem came up.
Apparently, the checkout was not altering the local files.
Let me explain it better:
My stream is simple, clone, change code, commit, push/pull, branch, checkout and some merges.
So, I made a new branch to tidy up the project’s folder structure.
I removed some, moved others, created new folders, etc. I adjusted everything to make the project work.
When I did git status, I received a giant list of deleted or created folders/files. I went to see an easier way to do git rm and add. So with git add --help, I decided that add --all was a good solution for me.
I committed and pushed, then I left.
In the morning, my team took the branch where I changed the paths of the folders and started working. Later, when I arrived, I decided to pull to get the group’s changes.
I went from branch to branch to see the changes (checkout branch-name).
I realized that all the branchs were wrong, and I started researching why. I soon came to the conclusion that when checking out among the branchs, my new structure continued, and mixed with the old folder structure.
I tried to reset HEAD --hard, but I couldn’t. I noticed that regardless of the commit you were in, the files weren’t changed.
The way was to make a new clone of the project. I imagine this was a nut solution, but after hours, it was the solution.
I wish I knew what I did wrong, to make it happen.
Anyone have any idea? My concept about checkout is misguided?
Well, explaining this way doesn’t help much for me to be able to help, but you did check the following: 1. The changes actually went to the remote repository ? 2. You are on the correct branch ? 3. You tried to clone a new directory to see the structure ? 4. When you pulled, was it successful ? you saw the change logs ? Not the solutions, but it will help you check where your error is.
– Josh
@Josuéeduardo 1) yes, the changes went to the repository. 2) Yes, I am in the correct branch. 3) Yes, in the end, it was the solution I had to get back to work, I made a clone in another directory. 4) Yes, there was no conflict in Pull. 5) I don’t know how to check logs... I will arrange this.
– Mr-Cutia