简体   繁体   中英

cloning files on server to a git repository

I am new to git and trying to understand the basics. I have found lots of tutorials on how to push files to a git repo, and then clone to a server, but I cant find anything about completing the reverse action, that is cloning files for a website from a server to a git repo before editing them. Is there an easy way of doing this? Thanks

I'm not sure what you mean by "server" and "website". Git is only about repositories.

You never push files. You can only push branches (or similar refs).

Cloning is just creating a local repository and fetching all branches from a remote repository into you new local repository.

Generally you use git push to transfer local branches to some remote repository and git fetch to transfer branches from a remote repository to your local repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM