![]() What if you missed a detail, like the ones above? What if git added a global config parameter that affected clones? You'd have to change your commands to take it into account, but git clone would already know. It's guaranteed to do the right thing now and in the future. Things like -shared would be really difficult to add to your listed commands. ![]() It's got handy options to change its behavior. As for difficulties one way or the other, even assuming you iron out all the differences between a default clone and a "manual clone", my advice would be not to reinvent git clone: I want the search engine also search in group and subgroup name. It's possible I've missed a thing or two. 1 votes Upvote When I clone a repo from gitlab, 'search box' search only in repo name. This is very significant - with your steps, if you have master checked out and you type git pull, it won't know what to do. You could add this to your listed steps as git config origin git config refs/heads/master. You also haven't set up your master branch to track origin's, which the clone does. And use the clone when a Git repo is active and you want to create a backup or extra node point. Obviously, you should use the bare git init approach when you are starting a brand new project. Create a new bare git repo with the git init bare switch. A git fetch origin would take care of that in your listed steps. Clone an existing repository with the git clone bare switch. If the remote has several branches, the clone creates remote branches remotes/origin/foo, remotes/origin/bar. Your git pull won't create any remote branches. This is rare, but a good detail to be aware of. If, for some reason, the remote's HEAD is not master, the clone will do the right thing - give you a branch named the same as the remote's, instead of master. I can think of a few differences, all to do with branches: That said, your steps are close to, but not entirely the same as, what git clone does. A lot of commands, whether git commands or common programs, do things in one line you could otherwise do in ten.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |