Jump to content

Recommended Posts

Posted (edited)
Hello guys,

 

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:

 

[intro]

 

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:

 

[step by step]

 

1) Open IntelliJ

2) File -> New -> Project from Version Control -> GIT

3) At git repository URL set: https://bitbucket.org/l2jserver/l2j_server.git 

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

8 ) After you saw your branch there let's push it in your repository by using this command:

git push -u origin develop --force

9) Add l2jserver upstream by using this command:


10) Check it was added: git remote -v 

11) Fetch the upstream: git fetch upstream . It will outputA 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.

Edited by AndreiD

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...