With Git from the local to upload files to GitHub

These days busy with rescue collapse out of the blog, no time to update the code on GitHub PAT manually one by one pass too slow, so I steal a moment to learn Git transfer files to GitHub, non-teaching tutorial does not graphic, there are a few premise

You have to have a github account, do not go to register now https://github.com/

Also need to git, did not go to the installation https://git-for-windows.github.io/

  1. Github into the home page, click New repository to create a new project
  2. Fill in the appropriate information click Clone or dowload will be an address, copy the address of the secondary
    • Repository name: warehouse Name
    • Description (optional): DESCRIPTION The warehouse
    • Public, Private: warehouse permission (publicly shared, private or designated collaborators)
    • Initialize this repository with a README: add a README.md
    • gitignore: warehouse type does not require versioning, and generate the corresponding files .gitignore
    • license: type of certificate, generates a corresponding file LICENSE
  3. To local operation, the first right to your project if you previously installed git successful, the right will be two new options appear, respectively Git Gui Here, Git Bash Here, here we choose Git Bash Here, enter the following interface, Test_Bluetooth namely for my project name.
  4. (Critical step), the above github repository cloned into local ( https://github.com/CKTim/BlueTooth.git replaced address before you copy the entire mine)git clone https://github.com/CKTim/BlueTooth.git
  5. After this step your local project folder below will be more of a folder, the folder name that is above your github project name, and I out of a multi-PAT- folder, we next local project file folder of all file (in addition to the new multi-file out of the folder do not), the rest are copied to the new extra folder
  6. Enter the command cd PAT-, enter PAT- folder, then depending
    enter the following code other times to complete the remaining operations:
    • git add .        (Note: Do not forget the back, this is the Test folder following files are added to come)
    • git commit -m "提交信息"  (Note: "Submit information" into which you need, such as "first commit") If this step appears that shows that after you install git, no local accounts.
      git config --global user.name “Your name"
      git config --global user.email “[email protected]"What follow-up console prompt, then follow the prompts to configure it accordingly
    • git push -u origin master   (Note: This operation aims to push the local repository to github above, this step requires you to enter account number and password)

git status can display the file git add a party, if you can not upload successfully lose this line commands look inside, there is no file

Guess you like

Origin www.cnblogs.com/daker-code/p/12292117.html