How to use git ? git

I am working on a website, and I need to use Git for practical reasons. However, I think I have not totally understood how it works.

I want to do something quite simple, and I am working on localhost. I make several changes, and sometimes I use Git for put the new or modify files on the server.

Edit²: after reading some docs, I have reinit all my git repositories. I really understand nothing to git. So, I connect to my server, and I commit the files. After I reinit my local repository. I add my remote and I did git pull carpe master (carpe is my alias for the remote server). If I do git checkout master on local, I see all the paths from the tracked files from the server. But git did not download the files to the working tree... I really do not understand. What should I do for getting the file in my local working tree ?


By pushing, you've sent your commits to the remote git repository at ssh://user@myname.my/mypath/.git . However, the content of this repository is independent to what your Web server is serving -- the HTML you see in your browser (this is known as the working copy). What you need to do now is to pull the changes from the repository into the server's working copy ( git pull origin ).

It's really worth putting in the time to go through a decent git tutorial, as others have suggested. My personal favorite is http://gitimmersion.com/.


You have just pushed your changes from the local master branch to the remote master branch. (ie sent your changes to the remote server.)

Have a look here for a descent introduction to git


This may help: https://stackoverflow.com/a/9204499/631619

I think the key things to know are:

tracking branches & 'origin'. Understanding this is key. It's the inbetween part of how changes flow to and from remote servers and local environments.

链接地址: http://www.djcxy.com/p/7556.html

上一篇: 为什么“git push helloworld + master:master”而不是“git push helloworld”?

下一篇: 如何使用git? 混帐