Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to upload local code to git repository

Shulou Source: shulou.com Published: 2022-06-02 08:00:21 11月16日 Update

This article mainly explains "how to upload local code to git repository", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's take you to learn "how to upload local code to git repository"!

1. Initialize the repository

git init This command creates a.git folder in the current directory

Add files to the repository

2. git add .

Add files to the repository (just add to cache); . Add all the files in the folder; if you want to add a specific file, just put. Change to a specific file name

Submit the added file to the repository and fill in the submission comments

3. git commit -m "comment statement"

4. Create your own Repository on github

5. Associate local repositories to github

git remote add origin http://Own repository url address

6. Upload code to github remote repository

git push -u origin master //first push

git push origin master //After the first push, directly use this command to push the modification

At this point, I believe everyone has a deeper understanding of "how to upload local code to the git repository," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Tags: File repository code version push content command folder first time learning practical deeper representative interest just address remarks practical practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Microsoft vpn Xiaomi Shulou Technology