Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Section on "Branching" in relation to collaboration. #441
A majority of times when collaborating on open source projects, you will not just push changes directly to the master branch, but rather to a separately named branch, and then create a pull request. Currently, this lesson contains no information about branching. The lesson could benefit from the idea of "branches" and how these can be used locally for trying new types experiments in your every day life in addition to collaborative environments.
I want to add that it should be in-scope as some users may not reach open source project level although user may be working alone / with colleges. Its best they learn how to do branching from the start, atleast locally.
So suggestion below may be applicable to "Tracking Changes" or "Collaborating" lessons or even possible new lesson of "Best Practices" or "Branching 101" (which could include Naming branches, working locally, merging, remote branches etc)
When I read branching may be too advanced topic ref: guide.md, it made me question it. SWC does have lessons such as "Exploring History" of checking out git commits and not losing HEADs (which may take them to rebasing)! To me that seems far more complex than branching, which can save you lots of headaches and it is a best practice!
Problem: User clones a repo, does work. Discovers the path they were on is wrong or no longer needed! What should the user do?
(A lesson would go in detail of explainations) * $> git clone / git pull origin master * $ master> git checkout -b "To-be-abandoned" * $ To-be-abandoned> Create files * $ To-be-abandoned> git adds and commits * $ To-be-abandoned> Create more files. Oh! No longer need to work on this! Life Saving Steps * $ To-be-abandoned> git add + git commit -m "Do not need it anymore" * $ To-be-abandoned> git checkout master * $ master> git branch -d To-be-abandoned (delete the branch) * All is well