Monday, December 8, 2014

Pushing updated files from Local to Remote Repository

In the previous post Pushing local repository changes to remote repository we saw on how to add newly created files in the local copy to remote repository, now we shall see on push updated files from the local working copy to remote repository.

Files which are present in both local and remote repository can be updated to the remote repository, by using the following steps.

1.    Modify the file to be updated in the local working directory.
2.    Once this is done, the changes to the file will be reflected in SourceTree
3.    Let us add a new line to a file which exists in both local and remote.
4.  Once this done SourceTree shows the modified file as follows.

5. Right click on the newly added files and select Add to index (or) select and drag the files from the “Working Copy Changes” panel to the “Staged Changes” panel.
6. This will move the file to Stage / Index.
7. Once staged, commit the changes in the “Staged Changes” panel by clicking on the Commit Icon in the toolbar.
8. In the “Commit Message” which appears, enter a command to commit and click on the commit button.
9. In the Commit Mode dropdown, make sure that the “Staged changes” option is selected and click the commit button
10. That’s it the changes in the Staging region have got committed to the local repository.
11. Notice that commit updates the changes only to the local repository; the changes will not be reflected in the remote repository until we push the committed changes to the report repositories.
12. Once committed, click on the clicking on the “Push” icon in the toolbar.
13.  In the push window make sure that the “push to repository” points to the correct remote repository to which the changes needs to be pushed.
14. Select the correct local and remote branch and click OK.
15. The changes are copied to the remote repository and is available for others. The commit history is updated in Bitbucket.

Search Flipkart Products:

No comments: