I am studying a book about TDD, and in an appendix, they ask us to use code which is given in a GitHub branch. I know I can make a new folder, do git init
, and use git pull
, but it would be easier to have a separate branch and have a branch from GitHub there. Could you advise me on how I can take code and history from a branch in GitHub, and make that the code and history of a new branch in my local repo? I have created the branch using git checkout -b new_branch
. Now, if I use git pull
, it shows me merge errors, because my branch and the code from GitHub has some substantial differences.
Note: I still haven't added an origin. I just commit to my local repo, and none of my code is on GitHub.
Thanks.