Upload personal Project code through git to Coding.net

Source: Internet
Author: User
Tags git client using git git clone

Every time you use Git always go to Baidu some of the methods used, here will be used to summarize the method for later use.

First, install Git client software

There's a lot about git client software, where old Chiang is using Git for Windows (http://msysgit.github.io/)


Install Git to the finish, we continue to start git use.

Second, create a remote warehouse

In general, we will use a third-party git remote warehouse, such as foreign GitHub use more, the domestic coding.net, Gitcafe and Oschina and so on. Or we can deploy a private warehouse ourselves. Regardless of where the warehouse is used, the basic functionality is the same, it is to register the account in these Third-party platforms, then create a private or shared warehouse, and then push the local files. Here the use of a Coding.net domestic project management platform, for other platforms is the same, here is only for the demonstration convenience, and is the Simplified Chinese interface, the general user looks more cordial.

The most important thing here is to create a warehouse in the remote warehouse so that we can submit the local files to the warehouse.


In the coding background page, we have seen the Create Item button, we first create the project.


The project name here we take, to know which project warehouse put which project, this we want to understand, do not submit the wrong time.

Third, open the Git Client connection warehouse

A-Find a location on our local computer and create a new folder to store the files for this new warehouse. Then go into this folder, right-click the mouse, and choose Git Bash option to open the GIT command box.

B-Connect to the remote warehouse

Here we need to find the https file path from the remote repository first

Regardless of which platform there is, we need to do local and remote docking, we need to first download the remote file to the local. This will allow us to file new files in the local file can be synchronized and uploaded to the remote warehouse.

We need to configure the SSH public key first

Through Git management tools, make GUI. Generate SSH link git public key.

You can also use the command to complete

$ ssh-keygen-t rsa-c "your_emali@youemal.com"
Note the password entered in the build public key, which is often entered during later Git access

To be configured in the Conding account:



Regardless of which platform there is, we need to do local and remote docking, we need to first download the remote file to the local. This will allow us to file new files in the local file can be synchronized and uploaded to the remote warehouse.

Create a new folder and open the Git Bash window under the folder to associate the local and remote libraries with the following command

$ git clone git@git.coding.net:hpugym/mystudy.git
cloning into ' mystudy ' ...
Enter passphrase for key '/c/users/administrator/.ssh/id_rsa ': [Enter password entered in the steps above public key settings]
remote:counting objects:53, Done.
Remote:compressing objects:100% (41/41), done.
Remote:total (Delta), reused 0 (Delta 0)
receiving objects:100% (53/53), 7.26 KiB | 0 bytes/s, done.
Resolving deltas:100% (15/15), done.
After downloading we can look at the local folder is not a lot of files, our remote warehouse files are downloaded to the local.

Four: Create a new file and upload it to a remote repository

ADMINISTRATOR@USER-20170701JR MINGW64 ~/desktop/gittest/mystudy/javascript/nodejs (Master) $ touch test.txt  "1, new file" Administrator@user-20170701jr MINGW64 ~/desktop/gittest/mystudy/javascript/nodejs (Master) $ echo Somgthinf  > test.txt "2. Add something to the new file" Administrator@user-20170701jr MINGW64 ~/desktop/gittest/mystudy/javascript/nodejs (master) $ git add test.txt "3. Add the file to the tracking list" warning:lf'll be replaced by CRLF in Javascript/nodejs
/test.txt.

The file would have its original line endings in your working directory.                       ADMINISTRATOR@USER-20170701JR MINGW64 ~/desktop/gittest/mystudy/javascript/nodejs (master) $ git status
"This command allows you to query the list of files in the tracked state" on branch master Your branch is up-to-date with ' origin/master '. Changes to IS committed: (use "git Reset head <file&gt ..." to unstage) new File:test.txt Administrator @USER -20170701JR MINGW64 ~/desktop/gittest/mystudy/javascript/nodejs (master) $ git commit-M "a" 4. Enter the submitted file with this command to describe "a" [Master E6243c6], "The content of the description", "The" ("a", 1, 1 insertion (+) Create mode 100644 javascript/nodejs/test.txt ADMINISTRATOR@USER-20170701JR MINGW64 ~/desktop/gittest/mystudy/ Javascript/nodejs (Master) $ Git push Origin master "5. Upload to remote warehouse via push Warning:permanently added the RSA host key for I
P address ' 123.59.83.43 ' to the ' list of known hosts.
Enter passphrase for key '/c/users/administrator/.ssh/id_rsa ': Counting Objects:5.
Delta compression using up to 2 threads.
Compressing objects:100% (4/4), done. Writing objects:100% (5/5), 413 bytes |
0 bytes/s, done. Total 5 (Delta 2), reused 0 (Delta 0) to Git.coding.net:hpugym/mystudy.git ff7410b.
 E6243C6 Master-> Master
Once we are done, we can see that the Test.txt document has been uploaded to the remote repository.

V: Update remote repositories to local

If the remote repository is updated by other partners, it needs to be updated

ADMINISTRATOR@USER-20170701JR MINGW64 ~/desktop/gittest/mystudy (master)
$ git pull https://git.coding.net/ Hpugym/mystudy.git
Username for ' https://git.coding.net ': Hpugym
remote:counting objects:5.
Remote:compressing objects:100% (4/4), done.
Remote:total 5 (Delta 2), reused 0 (Delta 0)
unpacking objects:100% (5/5), done.
From https://git.coding.net/hpugym/myStudy
 * Branch            head       -> fetch_head
updating 0c1fd58. B5a8d33
Fast-forward
 javascript/nodejs/test.txt | 1 +
 1 file changed, 1 insertion (+)
This updates to the latest project.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.