Articles → Git → Push Code In Remote Repository Using Sourcetree

Push Code In Remote Repository Using Sourcetree






Map Local And Remote Repository




  1. Create a local repository (check this article to create a local repository http://gyansangrah.com/gyansangrah/article/create_local_repository_sourcetree)
  2. Click on the Settings tab on the top right-hand side of the screen.
  3. Picture showing the settings button in the sourcetree

    Click to Enlarge

  4. Follow window will appear
  5. Picture showing the repository settings screen in source tree

    Click to Enlarge

  6. Click on the Add button a window will appear to enter the remote repository credentials. Enter the information and click on Ok.
  7. Picture showing a pop up window for adding the repository paths

    Click to Enlarge

  8. Click on the Ok button of parent window to close the window.
  9. Picture showing the remote path added in the repository settings screen

    Click to Enlarge



Perform Push Operation




  1. Add a file 1.txt in your local repository.
  2. Picture showing the file in the local repository

    Click to Enlarge

  3. It will come as unstaged changes in sourcetree.
  4. Picture showing the unstaged changes in the repository using sourcetree

    Click to Enlarge

  5. Click on ‘Stage All’ or ‘Stage Selected’ to add the file in the staging folder.
  6. Click on the Commit button on the top left-hand side of the window
  7. Picture showing the commit button for committing the changes

    Click to Enlarge

  8. Add the comments and click on the Commit button at the bottom.
  9. Picture showing the window to add commit comments

    Click to Enlarge

  10. Once the commit is done, click on the Push button on the top of the screen.
  11. Picture showing the Push button for pushing the changes on the remote server

    Click to Enlarge

  12. Following window will appear
  13. Picture showing a popup window to push changes

    Click to Enlarge

  14. Click on Push button
  15. Picture showing a popup window to select the branch where changes will be pushed

    Click to Enlarge

  16. A progress dialog will come to show the progress of Push operation
  17. Picture showing the progress of push activity on the remote server

    Click to Enlarge

  18. Once completed, you can see 1.txt on remote repository.
  19. Picture showing file on the server after pushed is done

    Click to Enlarge



Posted By  -  Karan Gupta
 
Posted On  -  Monday, November 25, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250