tags:

views:

32

answers:

2

It's possible that I'm not really understanding how git works here, but I have a development git branch, and then I created a new branch called development_cached

I switched to the development_cached branch, freeze rails version for my project, then I ran two commands git add . and git commit respectively, and then switched back to the development branch to make some other changes to that branch.

When I ran ls vendor in development branch, its showing rails folder what I have added and committed to development_cached branch.

Can anybody please explain me why is it happening like this?

A: 

Can you check the contents of the vendor folder? Was there anything added to it that was not committed to the development_cached branch?

Manoj Govindan
Yes Manoj, whatever changes I made in development_cached branch, I committed everything
Rajat Subhra Ghosh
+2  A: 

Try git reset --hard HEAD while on development to reset back to the state of the latest commit in that branch (and remove any other files from the directory). Note that this will wipe any uncommitted changes.

Amber
Yes Amber, issue has been solved after running git reset --hard HEAD to my development branch.
Rajat Subhra Ghosh
Thanks for helping out
Rajat Subhra Ghosh
Generally if the answer is one you're looking for, you should click the green checkmark outline next to it to mark it as Accepted.
Amber