How to upload a project to Github

前端 未结 23 1374
误落风尘
误落风尘 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:05
    1. First You have to create an account on Github
    2. Then create new Project - name that Project as you want then your project url is shown
    3. Now copy the url
    4. Then open Command Prompt and go to the directory or folder which you want to upload using cmd
    5. Then type the following Commands

       git init
       git add .
       git commit -m "initial commit"
       git remote add origin PASTE URL
       git push -u origin master
      
    6. Now check your GitHub account, Repository is successfully uploaded.

    For Complete guidance, you can watch this video.

    0 讨论(0)
  • 2020-11-29 15:05

    Download SourceTree. It is available for windows7+ and Mac and is highly recommend to upload files on github via interactive UI.

    0 讨论(0)
  • 2020-11-29 15:05
    1. We need Git Bash
    2. In Git Bash Command Section::

    1.1 ls

    It will show you default location.

    1.2 CD "C:\Users\user\Desktop\HTML" We need to assign project path

    1.3 git init It will initialize the empty git repository in C:\Users\user\Desktop\HTML

    1.4 ls It will list all files name

    1.5 git remote add origin https://github.com/repository/test.git it is your https://github.com/repository/test.git is your repository path

    1.6 git remote -v To check weather we have fetch or push permisson or not

    1.7 git add . If you put . then it mean whatever we have in perticular folder publish all.

    1.8 git commit -m "First time"

    1.9 git push -u origin master

    0 讨论(0)
  • 2020-11-29 15:08

    I did as follows;

    1. git init
    2. git add .
    3. git commit -m "Your_message"
    4. git remote add origin @your_git_repository
    5. git push -u origin master

    Of course you have to install git

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题