Git

All code should be committed to version control from inception. This is a critical part of managing development and regression, and makes it much easier to share and collaborate - now or in the future. We recommend git. Free hosting is available on github for open source projects and bitbucket for private ones.

Branching

You may find that a more complex branching process and release strategy becomes useful as your project’s code base and contributor base grows bigger. This is particularly important if one group is working on preparing code for a release while another is adding new features. Pick one (git flow branching is recommended) and document that choice in your source.

If using the develop -> stable model, it’s important to set the default branch to develop in github settings. This is the branch pull requests will be opened against, and should be set correctly if you followed the steps above.

FAQ

I’ve lost a file that I didn’t commit

Unfortunately, git can’t help you here. Commit early and often. Local backups (such as time machine) may have a copy.

I’ve lost a commit

git reset --hard and git rebase, can cause you to lose progress if you make a mistake. Fortunately it is almost always possible to recover commits in git using the reflog. See Data Recovery.

I’ve committed a large file and now my repository is huge

Large binary files generally shouldn’t be kept in source control. Github has a 100MB per file limit. If you must store a large file in source control, consider using Large File Storage.

To remove a file from your git tree, see Removing Objects.

LFS Recovery Fork pull model GUIs Github