3 ms·
Some people like git pull, but I prefer git fetch. This gets all's the history from the remote repo without applying any changes. Then you can run something lik
by thrush 12y ago
Some people like git pull, but I prefer git fetch. This gets all's the history from the remote repo without applying any changes. Then you can run something like 'git rebase -i origin/master' which is where I think git can really shine.
There is an excellent link out there that explains git in layman's terms. I think it's called git for hackers or something of the sort. It's much easier than the docs in my opinion.
- SDGT 12y agoBest practices are to not use pull unless you certainly know you should. Things should be fetched then merged with two separate commands.
- gizmo686 12y agoPulling is equivelent to doing a fetch then a merge. Unless you plan on doing something between the two steps (like inspecting FETCH_HEAD yourself), then there is no advantage to not simply pulling. Of course, if (like thrush) you do not plan on doing a merge, then you will need to do the fetch manually and do what you do want to do. Although, git pull does have a --rebase option, but I am not sure if you can pass the -i flag to it. Having taught people how to use git, I found that it is easier to not show them the pull command until they are used to doing fetch && merge.
- mitchty 12y agoCan just git pull --rebase too instead of fetch/rebase.