Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Upload local files to GitHub

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Recently, I made an automatic monitoring system for operation and maintenance with reference to the idea of an open course. I want to upload the code to a GitHub built by the teacher on this side of our information center in order to learn and communicate. A pit was encountered during the upload process. The detailed process is described below for subsequent reference (GitHub address: https://202.207.177.110). My local environment is Centos6.3

1. First of all, build a project on GitHub, which is very easy, so I won't repeat it.

2. Set the global environment locally (the username and mailbox here are the usernames and mailboxes I used when registering)

# git config-global user.name "fsy"

# git config-global user.email "2663154088@qq.com"

3. Generate a pair of keys locally, and place the public key in the public key location in the settings of GitHub (this is very important, because I did not do this step, so I cannot upload)

# ssh-keygen-t rsa-C "2663154088@qq.com"

4. Create a new knowledge base

# git clone git@202.207.177.110:fsy/test.git (this path comes from the path where the project was created above)

5. Add the project file to the repository (premise: the file you want to upload has already been placed in the test directory)

# cd test

# git add.

6. Commit the file to be added to the warehouse

# git commit-m "name" (note that you must have a name for each upload, which can be defined by yourself)

7. Upload the code to the remote GitHub warehouse

# git push-u origin master

At this point, the upload is complete.

Add: if it is an existing directory, add content to it

# cd test

# git init

# git remote add origin git@202.207.177.110:fsy/test.git

# git add.

# git commit-m "name"

# git push-u origin master

Welcome to criticize and correct!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report