Select your PC environment:
Push the local repository "tutorial" that you have created earlier in Tutorial 1 Git Basics.
Windows
Right-click on the tutorial directory and click "Push".

Click "Manage" to display the next screen.

In the following screen. Enter "origin" in the Remote field and enter the URL of the remote repository from the previous page and click "Add New/Save". This will add "origin" that corresponds to the remote repository URL in the remote list. Click "OK".


If you are on Console, the remote repository named "origin" will be used by default if you omit the remote name when pushing/pulling. That is because "origin" is commonly used as a remote name by convention.
At the Remote item on the Push screen, select “origin” which you have recently added, then click the “OK”.
Enter your Backlog username.

Next, enter your Backlog password.

The next screen shows that push has been successfully completed.

Mac
Open SourceTree and select the “tutorial” repository.

On the Repository Operations screen, click the "Settings" button on the right side of the toolbar.

In the next screen, click "Add".

Enter "origin" in the "Remote" field and enter the URL of the remote repository from the previous page and click "OK".


Next, you will be asked to authenticate with Backlog, so enter your Backlog username and password.

The remote repository "origin" is now shown in the Remotes list and we can start pushing changes to Backlog.

If you are on Console, the remote repository named "origin" will be used by default if you omit the remote name when pushing/pulling. That is because "origin" is commonly used as a remote name by convention.
Now let's try to execute a push by clicking the "push" button on the SourceTree toolbar above.

The following dialog will be displayed. Select the "master" check box and click "OK".

When the push is successfully completed, "origin/master" which represents the commit on remote will be shown in the Description column of the commit.

Command Line
You can give an alias or nickname to a remote repository. This is helpful as we do not need to remember the long address of the remote repository each time we intend to do a push. In this tutorial, we will register a remote repository name as "origin".
To add a remote repository, use the "remote" command. is used as an alias of a remote repository, followed by with the URL of the remote repository.
$ git remote add
Execute the command using the URL of the remote repository from the previous page. The new remote repository URL will be given an alias of "origin".

$ git remote add origin https://[your_space_id].backlogtool.com/git/[your_project_key]/tutorial.git
The remote repository named "origin" will be used by default if you omit the remote name when pushing/pulling. That is because "origin" is commonly used as a remote name by convention.
To push changes to the remote repository, use the "push" command. Assign the address in , and the branch name in , that you wish to push to. We will be covering branch in greater depth in the "Working with Git" section.
$ git push ...
Run the following command to push a commit to the remote repository "origin". If you specify the -u option when executing the command, you can omit the branch name the next time you push to the remote repository. When you push to a vacant remote however, you must specify the remote repository and branch name.
When asked for the user name and password, enter your Backlog user credentials.
$ git push -u origin master
Username:
Password:
Counting objects: 3, done.
Writing objects: 100% (3/3), 245 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://monkey.backlogtool.com/git/BLGGIT/tutorial.git
* [new branch] master -> master
Open the Git page on Backlog. You will find that a new update that corresponds to your push to the remote repository has been listed under recent updates.

The pushed file has also been added under the list of files of the remote repository.
