Code#
To support rapid development without breaking stable versions, this project uses a two-layer branch model:

dev: New features and some bug fixes are merged here. This branch allows collective testing, conflict resolution, and further stabilization before merging into the stable branch.
main: Stable branch where PIP releases are created.
By default, branches target main, but most contributions should target dev.
Exceptions: Direct merges to main are allowed if:
yfinance is massively broken
Part of yfinance is broken, and the fix is simple and isolated
Not updating the code (e.g. docs)
Creating your branch#
Fork the repository on GitHub. If already forked, remember to
Sync fork
Clone your forked repository:
git clone https://github.com/{user}/{repo}.git
Create a new branch for your feature or bug fix, from appropriate base branch:
git checkout {base e.g. dev} git pull git checkout -b {your branch}
Make your changes, commit them, and push your branch to GitHub. To keep the commit history and network graph compact, give your commits a very short summary then description:
git commit -m "short sentence summary" -m "full commit message" # Long message can be multiple lines (tip: copy-paste)
Running a branch#
Please see this page.
Git stuff#
You might be asked to move your branch from
main
todev
. This is agit rebase
. Remember to update all branches involved.# update all branches: git checkout main git pull git checkout dev git pull # rebase from main to dev: git checkout {your branch} git pull git rebase --onto dev main {your branch} git push --force-with-lease origin {your branch}
git rebase
can also be used to update your branch with new commits from base, but without adding a commit to your branch history like git merge does. This keeps history clean and avoids future merge problems.git checkout {base branch e.g. dev} git pull git checkout {your branch} git rebase {base} git push --force-with-lease origin {your branch}
git squash
tiny or negligible commits with meaningful ones, or to combine successive related commits. git squash guidegit rebase -i HEAD~2 git push --force-with-lease origin {your branch}