Backlog uses cookies to deliver our services. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.

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 Push

Click "Manage" to display the next screen.

Click the control button.

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".

Enter the remote repository URL and click the "Add New/Save" button. Enter the remote repository URL and click the "Add New/Save" button.

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.

Enter Backlog username

Next, enter your Backlog password.

Enter Backlog password

The next screen shows that push has been successfully completed.

If you see "success" on the screen it means success.

Mac

Open SourceTree and select the “tutorial” repository.

Select "tutorial" repository

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

Click the setting button at the right side in the tool bar on the repository operation screen.

In the next screen, click "Add".

Click Add button

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

Enter the URL of the remote repository and click OK button Enter user name and password for Backlog

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

Enter user name and password for Backlog

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

origin was added

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.

Click the push button at the tool bar on the tutorial repository operation screen.

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

Click the OK button after check the check box of master.

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

The "origin/master" shown by the remote repository has been added.

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".

The remote repository‘s URL is registered under the name "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 push item is added to the recent updates.

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

The file from the pushed repository is added.
Next, let's clone this remote repository!