New to git — how do I get changes from cloned repo into original repo?

Usually on the server you would do a git init --bare which creates a repo with no working directory. If that is the route you took then you would have to pull the changes from there to the web directory as the "deployment" step. So your work flow might look like On dev PC: 1.

Git clone *make code changes* 2. Git commit -am "fixed a bug" *add some new feature* 3. Git commit -am "added cool new feature" 4.

Git push origin master On the server: *cd to www folder* 5. Git pull Clones server repo to your dev machine, which you've already done Commits the bug fix to your local repo...not the server's repo Commits the new feature to your local repo...again, not the server's Pushes all changes from your master branch to the server's master branch At this point, none of your changes are visible on your website. You would need to "deploy" them 5.

Pulls the latest changes from the central repo on the server to the web server's folder(s) that are being served up on the web There git tutorials are very good as is Pro Git a free online book.

Usually on the server you would do a git init --bare which creates a repo with no working directory. If that is the route you took then you would have to pull the changes from there to the web directory as the "deployment" step. So your work flow might look like... On dev PC: 1.

Git clone *make code changes* 2. Git commit -am "fixed a bug" *add some new feature* 3. Git commit -am "added cool new feature" 4.

Git push origin master On the server: *cd to www folder* 5. Git pull Clones server repo to your dev machine, which you've already done Commits the bug fix to your local repo...not the server's repo Commits the new feature to your local repo...again, not the server's Pushes all changes from your master branch to the server's master branch At this point, none of your changes are visible on your website. You would need to "deploy" them.5.

Pulls the latest changes from the central repo on the server to the web server's folder(s) that are being served up on the web. There git tutorials are very good as is "Pro Git", a free online book.

I don't really care about these recent changes, they are small and I can always patch them in later. – no. Sep 25 '10 at 0:44 progit.

Org/book/ch4-4. Html ... search for "git --bare init". The stuff above that is for user setup which I presume you've already done.

– dgnorton Sep 25 '10 at 0:52 I'm committing my clone into a bare repo on the server now. Did a git remote origin (bare repo). Should I be able to (re)move the .

Git folder on the original non-bare repo, then give it a remote to the new (bare, but with my stuff checked in from clone) repo, and then update to sync everything? – no. Sep 25 '10 at 1:26 @no, never tried that before.

– dgnorton Sep 25 '10 at 1:32 Heh, look at this: git checkout warning: You appear to be on a branch yet to be born. Warning: Forcing checkout of HEAD. Fatal: just how do you expect me to merge 0 trees?

– no. Sep 25 '10 at 1:33.

If the git repo on the server you pushed to is for the live system, you would probably have to do a EDIT git reset --hard|... HEAD on the server after a push I guess (see git-reset man page for details on whether using --hard or something else; --hard resets all non-committed modifications on your server). If the live system is somewhere else on the server, do a git pull from your repo you pushed to (in the directory with your live system). Push and fetch are complementary, i.e.

Pushing from A to B is like fetching A from B. Pull is a fetch followed by a checkout. EDIT: You should also read the article linked to by jmohr on the subtle differences between push and fetch / pull: git push not send changes to remote git repository.

And a bunch of files, but the changes don't appear and git show gives the same output afterwards... weird. +1 for "push and fetch are complementary. " – no.

Sep 25 '10 at 0:40 git checkout -f ("proceed even if the index or working tree is not HEAD") made the changes to the live files, but git info still shows the same diff... this bothers me. Should I do a git clean or something? – no.

Sep 25 '10 at 0:50 Sorry, just updated my answer.It should be git reset, but still, pushing to a non-bare repository is not very good practice as it seems. Better have a bare repo and pull from there to your live system. – Archimedix Sep 25 '10 at 0:52 The git-reset didn't seem to do anything useful as far as cleaning up git show, but I probably should have done it before I tried git checkout -f... hmm, I'll see what I can do about a bare repo – no.

Sep 25 '10 at 1:00 Doing a git reset --hard HEAD in the (non-bare) repository you pushed to should update your working copy files to the most recent pushed commit. – Archimedix Sep 25 '10 at 1:05.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions