Articles → Git → Push Code In Remote Repository Using Sourcetree
Push Code In Remote Repository Using Sourcetree
Map Local And Remote Repository
- Create a local repository (check this article to create a local repository http://gyansangrah.com/gyansangrah/article/create_local_repository_sourcetree)
- Click on the Settings tab on the top right-hand side of the screen.
Click to Enlarge
- Follow window will appear
Click to Enlarge
- Click on the Add button a window will appear to enter the remote repository credentials. Enter the information and click on Ok.
Click to Enlarge
- Click on the Ok button of parent window to close the window.
Click to Enlarge
Perform Push Operation
- Add a file 1.txt in your local repository.
Click to Enlarge
- It will come as unstaged changes in sourcetree.
Click to Enlarge
- Click on ‘Stage All’ or ‘Stage Selected’ to add the file in the staging folder.
- Click on the Commit button on the top left-hand side of the window
Click to Enlarge
- Add the comments and click on the Commit button at the bottom.
Click to Enlarge
- Once the commit is done, click on the Push button on the top of the screen.
Click to Enlarge
- Following window will appear
Click to Enlarge
- Click on Push button
Click to Enlarge
- A progress dialog will come to show the progress of Push operation
Click to Enlarge
- Once completed, you can see 1.txt on remote repository.
Click to Enlarge