Added contents on November 26, 2018:
For our own warehouse, we suggest that we clone the entire warehouse to a local path through the clone command. In this way, when we submit code from the local to the remote repository, we can directly drag the files to the path we cloned before, and then we can do git add. – > git commit – M ‘comment’ – > git push origin master. Because it is your own warehouse, it will be updated or maintained frequently before the work is finished. Therefore, it is very convenient to clone to the local, drag the file to the local path, and then push. Moreover, it is strongly recommended to create a general folder under which multiple remote warehouses of parallel clones can be set up. This is very convenient for each warehouse update and management.
For example: Apollo 0406 is the name of the folder where all warehouses are stored. The following are three remote repositories that have been cloned locally:
When we need to go to mycoding_ BC_ When submitting a file in the remote warehouse in August 201808, we put the file in the SRC Directory:
For example, coding1_ BC_ 201808 is the document we need to submit. We drag the file to the specified path of the specified warehouse, and then exit to mycoding_ BC_ In 201808, in the directory of the warehouse, perform the push operation (since the sample folder has been pushed, the result of commit is working tree clean)
The above operation is the way I use it now. Before Git is not skilled enough, let you see the use method is not concise enough, here I apologize.
For other people’s warehouses, we also clone the remote warehouse to the local, and then put the files to be submitted in the designated location of the local cloned warehouse. Then, in the path of the entire warehouse, submit it. The operation of opening idea described below can be omitted, but opening the compiler can facilitate us to write new code or run code to check for errors and view other code in the repository.
Content of the original blog:
Requirement: upload your own local file (pokerdemo2 under D: javatext / textone) to someone else’s code repository src.com lower
First of all, write your own local file pokerdemo2
2. Clone the target repo locally
3. Open the cloned project with idea, add the required package in the specified location, and drag in your own file in the package
4. Push the project that has added its own file to the target repo
Detailed steps: 1. Enter the local file pokerdemo2 directory, right-click git bash here
2. Initialize the local code repository: git init
3. Clone the code warehouse: git clone [HTTPS]
4. Open the cloned project locally
And create a new folder as the folder we make, SRC (Note: when the folder type is not the source code folder, right-click will not have new > package, this is to right-click the folder > mark directory as > source
Manually drag. 5 to the target file
6. Now that all the changes have been made, the remote warehouse where all the changes are submitted needs to be submitted
Enter the current mygit01 directory, right-click git bash here > git init > git add. – > git commit – M “submitted comments”
->Git merge origin master > git pull origin master > git push [HTTPS] master > this is the end.
7. Go to the remote warehouse to check the results
This article about git how to upload local files to the specified location of remote warehouse will be introduced here. For more relevant git files uploaded to the specified location of remote warehouse, please search the previous articles of developeppaer or continue to browse the related articles below. I hope you can support developeppaer more in the future!