Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As a git newbie I just do git pull. Is the problem that the merge makes the commit history harder to reason through in the future vs if you rebase?


Yes. Say you git clone a repository, and over the course of some months add a new feature. If you do a rebase then push, then it will appear in the history as if you had done a clone of the most recent version of the repository, done all your commits, and then pushed your changes to the main repository. Otherwise, the history will have merge commits in it where your commits to your local repository are merged with commits that were pushed to the public repository after you cloned your local repository.


If you aren’t working with multiple people or making a mess of your repo then git pull is fine.


Its probably more complex then I'm ready to explain in a comment section. But its useful when you are working on your own branch (IDK why you wouldn't be?) and need to integrate recent merges from the master branch on to your own branch.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: