I’ll be honest, my background is SVN, git completely confuses me, and git’s documentation doesn’t make any sense to me.
I know from some communications from coworkers that there are additional directories and files that are in the remote repository from stuff they’ve been working on. I don’t see them locally. I would like my local working space to reflect all those changes. I don’t know the names of all the files — there might be hundreds.
Something like clone, but doesn’t complain about a local copy being present. I’ve tried out all kinds of commands and got nowhere, either “fatal error” or “already up-to-date”.
So far, I’ve managed to overwrite and lose some existing work. Don’t know how I did it — I thought version control should never let this happen!
When using
git, you always have a clone of a remote depot.The rough equivalent of
svn updateisgit fetchwhich fetch all new commits from the remote depot followed by agit merge remote/master(or you can use thegit pullcommand that does those two steps). It is generally a good idea to commit locally all your changes before doinggit mergeorgit pull(git fetchis safe) as this will attempt to merge your changes with the remote branch, and can result in conflicts.The rough equivalent of
svn commitisgit pushthat will send your changes to the remote depot and will update the reference to the branch head there. You should always do a merge before doing a push otherwise you may delete your coworker changes by accident. Your team may have another workflow though (sending patch to a single person responsible for integration).If you’re coming from
svn, the easiest way to understandgitis to think that you are always working on a branch and that sharing with the rest of the team is done by merging the reference branch in yours or yours in the reference branch.Otherwise, I would really recommend reading Git book or at least the Git SVN crash course.