mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	This uses the myst_heading_anchors option to automatically generate header anchors and make Sphinx aware of them. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#auto-generated-header-anchors. Note: to be compatible with GitHub, MyST-Parser uses a slightly different convention for .md fragment links than .html fragment links when punctuation is involved. This does not affect the generated fragment links in the HTML output. Fixes #13264. Signed-off-by: Anders Kaseorg <anders@zulip.com>
		
			
				
	
	
		
			60 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
# Collaborate
 | 
						|
 | 
						|
## Fetch another contributor's branch
 | 
						|
 | 
						|
What happens when you would like to collaborate with another contributor and
 | 
						|
they have work-in-progress on their own fork of Zulip? No problem! Just add
 | 
						|
their fork as a remote and pull their changes.
 | 
						|
 | 
						|
```console
 | 
						|
$ git remote add <username> https://github.com/<username>/zulip.git
 | 
						|
$ git fetch <username>
 | 
						|
```
 | 
						|
 | 
						|
Now you can check out their branch just like you would any other. You can name
 | 
						|
the branch anything you want, but using both the username and branch name will
 | 
						|
help you keep things organized.
 | 
						|
 | 
						|
```console
 | 
						|
$ git checkout -b <username>/<branchname>
 | 
						|
```
 | 
						|
 | 
						|
You can choose to rename the branch if you prefer:
 | 
						|
 | 
						|
```bash
 | 
						|
git checkout -b <custombranchname> <username>/<branchname>
 | 
						|
```
 | 
						|
 | 
						|
## Check out a pull request locally
 | 
						|
 | 
						|
Just as you can check out any user's branch locally, you can also check out any
 | 
						|
pull request locally. GitHub provides a special syntax
 | 
						|
([details][github-help-co-pr-locally]) for this since pull requests are
 | 
						|
specific to GitHub rather than Git.
 | 
						|
 | 
						|
First, fetch and create a branch for the pull request, replacing _ID_ and
 | 
						|
_BRANCHNAME_ with the ID of the pull request and your desired branch name:
 | 
						|
 | 
						|
```console
 | 
						|
$ git fetch upstream pull/ID/head:BRANCHNAME
 | 
						|
```
 | 
						|
 | 
						|
Now switch to the branch:
 | 
						|
 | 
						|
```console
 | 
						|
$ git checkout BRANCHNAME
 | 
						|
```
 | 
						|
 | 
						|
Now you work on this branch as you would any other.
 | 
						|
 | 
						|
Note: you can use the scripts provided in the tools/ directory to fetch pull
 | 
						|
requests. You can read more about what they do [here][tools-pr].
 | 
						|
 | 
						|
```bash
 | 
						|
tools/fetch-rebase-pull-request <PR-number>
 | 
						|
tools/fetch-pull-request <PR-number>
 | 
						|
```
 | 
						|
 | 
						|
[github-help-co-pr-locally]: https://help.github.com/en/articles/checking-out-pull-requests-locally
 | 
						|
[tools-pr]: zulip-tools.md#fetch-a-pull-request-and-rebase
 |