Skip to content

Commit 63f18a4

Browse files
authored
move from wiki
1 parent 5fe861d commit 63f18a4

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

WorkingWithGit.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
### Fork the repository
2+
To view and make changes to your own copy of the repository, [fork the repo](https://github.com/Esri/arcgis-runtime-samples-java/fork).
3+
4+
### Clone your fork
5+
6+
Open your terminal and navigate to the directory you want to put the repository directory in. Then [clone your fork](https://help.github.com/articles/fork-a-repo#step-2-clone-your-fork):
7+
```
8+
$ git clone https://github.com/YOUR-USERNAME/arcgis-runtime-samples-java.git
9+
```
10+
11+
### Configure your fork for syncing
12+
To sync changes you make in a fork with this repository, you must configure a remote that points to the upstream repository in Git. Go into the project directory you just cloned. Run the following to add the upstream remote:
13+
```
14+
$ git remote add upstream https://github.com/Esri/arcgis-runtime-samples-java.git
15+
```
16+
Verify the changes by running
17+
```
18+
$ git remote -v
19+
```
20+
You should see something like the following:
21+
```
22+
origin https://github.com/YOUR_USERNAME/arcgis-runtime-samples-java.git (fetch)
23+
origin https://github.com/YOUR_USERNAME/arcgis-runtime-samples-java.git (push)
24+
upstream https://github.com/Esri/arcgis-runtime-samples-java.git (fetch)
25+
upstream https://github.com/Esri/arcgis-runtime-samples-java.git (push)
26+
```
27+
28+
### Sync your fork
29+
If this repository gets updated while you are working on your fork, you can add the changes to your fork by syncing it.
30+
31+
To check for any changes made to this repository, `cd` into your local copy of the repo and run
32+
```
33+
$ git fetch upstream
34+
```
35+
36+
Make sure to checkout whatever local branch you want the remote changes to be added to:
37+
```
38+
$ git checkout master
39+
```
40+
41+
Finally, merge the upstream changes into your branch with
42+
```
43+
$ git merge upstream/master
44+
```
45+

0 commit comments

Comments
 (0)