I am new to GIT. I have one production url and another as development url to which i want to push the new code.
development: http://development.myrepo.something
production: http://production.myrep.something
Now i usually work from different computers. I need a setup in which i can actually push all my work to the development url from different computers and when i get satisfied, i push the same thing in production url.
WHAT I HAVE DONE SO FAR
Copied exactly same files on both the URLS. At this point both the URL's give me same result in broswer.
Executed git init in both the directories and made them git repos.
- In the local git bash, I cloned from the production URL at some directory.
- I then added a remote origin like this - git remote add production ......//server path here
- Now i pulled from this repo like this - git pull production and it resulted like "UP TO DATE" which is what i wanted. Now pulling from both the branches give me the same message which is perfect.
So at thie point i thought, i can now work on local and then push to the development repo and when satisfied i can push again to the production repo.
But it doesn't work as whenever i push, it shows me the error because the repos aren't bare.
So what do i do now?
I am thinking to follow the branching approach from this Link
But the problem is that i want to see/test the work on the server in the development branch. With the approach mentioned in the above link, i can only see after the merge has been performed.
Please shed some light and point me in the right direction.