Tree Menu

Breadcrumb

Wiki (Wiki)

Back

Collaborating on an existing project with git

General workflow:

1. Make sure you are on the right working branch or create a new branch: `git checkout -b NEW`
2. Make changes
3. Stage changed files for commit: `git status` (optional, to check changed files), `git add`
4. Commit staged files and write a commit message: `git commit -m [ENH] my message`
5. Push commits in branch `NEW` to github `origin`: `git push origin NEW`
6. Create a PR pointing your branch NEW to your `origin main` or to the `upstream main`
7. Include changes in your local main branch: `git checkout main`, then `git pull upstream` or `git pull origin`
8. Repeate with step 1 or rebase your working branch `NEW` onto your local main and repeat with step 2: `git checkout NEW` and `git rebase main NEW`

Further Reading:

* https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository
* https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository
* https://git-scm.com/book/tr/v2/Git-Branching-Branching-Workflows

803 Views
0 Comments