Tutorial on using sourcetree to operate git in Mac, sourcetreegit
SourceTree is a free Git and Hg client under Windows and Mac OS X, and is also a tool for Mercurial and Subversion version control systems. Supports creation, cloning, submission, push, pull, and merge operations. SourceTree has a simple interface that greatly simplifies the Git operation between developers and code libraries, which is very practical for developers who are not familiar with Git commands. SourceTree has a complete Git function: You can use all the Git commands on a simple user interface to manage all the Git libraries with one click, either hosted or locally by one click, you can perform advanced functions such as commit, push, pull, and merge, such as patch processing, rebase, shelve, and cherry picking, you can connect to your code library hosted in Bitbucket, Stash, Microsoft TFS, or GitHub.
1. Installation of sourcetree:
Open the App Store: Search for sourcetree and download and install it (free of charge ).
2. Register a git Service (take http://git.oschina.net/as an example)
Open http://git.oschina.net/registration and verification, create a ticket forkproject and open it.
Record the git file address.
3. Open sourcetree and click new
Enter the address and select a local directory to store the code.
4. Now you can develop in the local directory. After the development is complete, open sourcetree again:
Drag files in the working tree into the index and click commit in the toolbar. in the pop-up box, Click commit again and click the green PUSH arrow, at this time, your file will be successfully uploaded to the git repository!
5. If error: failed to push some refs to error occurs, it is because the local version does not match the remote version. In this case, clone the code to the local computer again ~