Respect for the original: 52859166
I. INTRODUCTION
I think we are all familiar with GitHub now, and can also use GitHub's open source projects to their projects. But we also want to put some of our projects on GitHub and open source for everyone to use. This 2 days I was studying this thing, also looked at a lot of information is not systematic, but also go a lot of detours after all a beginner to learn these software, just at the beginning do not know what connection between the two, purely by their own blind groping, and finally successfully uploaded to my github, good gossip less say, do a thing, I'll take a step-by-step solution and post a picture or GIF.
Two. Preparatory work
1. Why use the Sourcetree graphical interface instead of Git's own git gui? First of all, I think the simplest point is that the Chinese version of Sourcetree is easy to use. Hey, look at this article about Gitbash, EGit, sourcetree three git management tools compared to the blog: http://www.open-open.com/lib/view/open1434502191411.html.
2.github Account: You can use GitHub, there must be an account. No, go directly to the official website sign up. Click to register
2. Download software: Git client: Website url https://git-scm.com/downloads or download the latest version. Click to download
Sourcetree client: Download To use the Chinese version. Click to download
3. Install the Software: Git client: Basically just click on the Next button to install, but in this interface, explain
The first is installed in the Windows environment, and the second one is installed in Windows or LUnix environments. Both are possible. After installing the GIT client, we will find that it has git GUI and git bash and git cmd three kinds, I simply say that git GUI is a graphical tool equivalent to a special management of your code or modify the code, the specific visual can see this tool, It's just the English version and the Sourcetree, but it works. and Git bash is to use Git's command to commit the project to your GitHub, I started to use the command to submit the code, unfortunately, the commit failure is very bad, and the command also has a few memory, do not fear we can use the Sourcetree interface to submit the project, No more worrying about the so-called Git command.
Sourcetree client: Just like git, you go all the way to the next, and the process comes up.
Encounter this direct point to cancel the X button, do not care this is actually installed in your file directory, there will be two saved dialog box also directly point
Cancel. There will be this again.
Because we're using a git tool, we don't need to use mercurial. You can open the software when you are ready to install it.
Three. Problems encountered
1. It is possible to report that you have not found the Git tool you installed,
Fix because sourcetree default does not support Git, so we have to open it. Open Sourcetree, "Tools" "Options" "Git",
You can change git.
and Git unicom. This is the only time I've ever met, and I've been doing it for a while.
2. In the new clone in the Sourcetree, after filling all of them, encountered the clone button display gray, the point fixed solution,
Use steps (source tree Chinese version )
) as follows:
: https://download.csdn.net/download/qq_38620276/10470902
Four. Uploading a project
1.github Create a warehouse for your project: Open the home page of your GitHub account,
Click New Repository,
Once created, go back to the Sourcetree tool.
2. Clone/NEW:
Open your GitHub project. Copy this value to the original path in the new clone that was put into Sourcetree,
If you encounter the cloning point is not moving, please look at the 2 of the problems encountered.
3. Submit the Project:
1. First find the folder where you cloned the target path, There's only one in it. Gitignore this file, you can copy your project folder to this folder in this folder, note this: similar to the SVN commit code, some files can be ignored, as I create a new Notepad in this folder,
Once you've created it, you can open the Sourcetree and look at your file status suddenly,
Here will encounter if there are many files when the software will get stuck, the workaround:
。
2. Submit the code: When you add the file you want to upload to the staging file,
, here on the click the Submit button, will pop up an input box, which is like when you submit the code to the server, you want to fill in the update log or submit the log, so that later good view and maintenance. After the submission has not been completed, notice that there is a red number on the push button, which means uploading several projects or warehouses at the same time.
Click on it to pop up the box, continue to confirm, push to your GitHub.
3. See if it is successful: you can log in to your GitHub to see if the upload was successful.
Uploaded successfully.
Four. End
I put together the two software for research on the upload project to GitHub to organize the above content, these are just I know the hope for everyone to help, and hope that there is no understanding of the can consult me. If the above content is wrong, I hope everyone enthusiastically pointed out that together to correct the growth, technical knowledge of the ocean a person is difficult to grow rapidly, willing to share the study. qq:2037646179. Thank you again for spending your valuable time reading!
Teach you to upload items to github with Git and sourcetree (go)