version control - New to git -- how do I get changes from cloned repo into original repo? -
this quite newb question, can't seem figure out.
here's did...
on server (via ssh):
- created site on dedicated server
- created git repo there (
git init
think?) - added , committed everything
at office:
- cloned repo on development machine
- pulled everything
- made changes local files
- added files again (is right? not svn!)
- did commit
- did push
...now, on server, if git show
, shows diff server's last copy of stuff removed , stuff pushed office being added. that's want happen. can't figure out is: what need on server make changes pushed office become "live?"
i've had pretty success deploying websites svn in past, , figure can away with git too... i'm missing piece of puzzle. help.
edit - noticed post: git - pulling changes clone onto master
should pulling office repo onto server instead of pusing there? ssh office server , have git+ssh office pull repo? seems kind of crazy, i'd rather figure out how make push go through if possible.
rephrasing question
i want apply patch shown git show
. git have built-in way of doing that?
answer
it looks git checkout -f
on server did wanted, creating --bare repo have been better way go (i've changed setup now).
usually on server git init --bare
creates repo no working directory. if route took have pull changes there web directory "deployment" step. work flow might like...
on dev pc: 1. git clone <path server repo> *make code changes* 2. git commit -am "fixed bug" *add new feature* 3. git commit -am "added cool new feature" 4. git push origin master on server: *cd www folder* 5. git pull
- clones server repo dev machine, you've done
- commits bug fix local repo...not server's repo
- commits new feature local repo...again, not server's
- pushes changes master branch server's master branch
at point, none of changes visible on website. need "deploy" them.
5.pulls latest changes central repo on server web server's folder(s) being served on web.
there git tutorials "pro git", free online book
Comments
Post a Comment