How to upload a project to Github

前端 未结 23 1370
误落风尘
误落风尘 2020-11-29 14:04

After checking Upload my project to github I still have no idea how to get a project uploaded to my Git Hub repository.

I\'m new to GitHub and I have no idea what to

23条回答
  •  再見小時候
    2020-11-29 15:09

    I assume you are on a windows system like me and have GIT installed. You can either run these commands by simple command prompt in the project directory or you can also use GitBash.

    Step 1: Create a repository in GIT manually. Give it whatever name you seem fit.

    Step 2: Come to your local project directory. If you want to publish your code to this new repository you just created make sure that in the projects root directory there is no folder name .git, if there is delete it. Run command git init

    Step 3: Run command git add .

    step 4: Run command git commit -m YourCommitName

    Step 5: Run command git remote add YourRepositoryName https://github.com/YourUserName/YourRepositoryName.git

    Step 6: Run Command git push --set-upstream YourRepositoryName master --force

    Please note that I am using the latest version of GIT at the time of writing. Also note that I did not specify any particular branch to push the code into so it went to master. In step 6 the GIT will ask you to authorize the command by asking you to enter username and password in a popup window.

    Hope my answer helped.

提交回复
热议问题