After watching a tutorial on Pluralsight regarding GIT i had understand better the power of GIT and i will try to make a small tutorial that can help you setting the environment for starting to develop.
So i will start, i will explain shortly what i try to achieve:
You want to start developing on L2JServer but you also want to have your own remote GIT server ( i am not sure it's write, please feel free to correct/edit my post), so you want to clone the sources then to upload it on your own GIT server ( GitHub, Bitbucket etc), but after that you also want to see what new things appear on L2JServer so you can keep your server updated with the last changes.
Also i will use IntelliJ for few commands
Now that i explained what i want to do let's start:
1) Open IntelliJ
2) File -> New -> Project from Version Control -> GIT
3) At git repository URL set: https://bitbucket.org/l2jserver/l2j_server.git like in the picture below. 4) Remove L2J origin with this command in Terminal window ( If you do not have terminal window you can find it at View -> Tool Windows -> Terminal )
git remote rm origin .
5) Now i assume you have an online GIT server when you want to push it. let's add your git project to this
git remote add origin https://YourUserName@bitbucket.org/Your ... arngit.git
6) Now check with git remote -v to see if it was added.
7) Use git branch to see what branch you use now
![Cool 8)](./images/smilies/icon_cool.gif)
git push -u origin develop --force
9) Add l2jserver upstream by using this command:
git remote add upstream https://bitbucket.org/l2jserver/l2j_server.git
10) Check it was added: git remote -v
11) Fetch the upstream: git fetch upstream . It will output there all branches.
12) Do a small change in a file. I did in README.md then
git add README.md
git commit -m " A small commit "
git push origin
So you made a change and submited to your GIT.
13) Let's see the differences between your branch and l2jserver branch
IntelliJ: VCS -> GIT -> Branches Then upstream/develop -> Compare.
There you will see 2 lists: one of them empty ( diff between upstream/develop and develop ) and one with a change (between develop and upstream/develop). The change is exactly your change. In the one that is now empty you will see all the times differences of what's have been added in L2jServer and you do not have.
I hope this will help and i am sorry if I have few mistakes here. Feel free to ask me if you have any questions.
I will take a second look later on what i write to try to improve it.