How to upload a project to Github

前端 未结 23 1372
误落风尘
误落风尘 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 14:52

    It took me like 2 hours to realize that I'm supposed to create Repo to GitHub (http://github.com/new) before trying to push my local files to github.

    After trying to push errors were like:

    remote: Repository not found.
    fatal: repository 'https://github.com/username/project.git/' not found
    

    I feel like an idiot, but I really would like to emphasize this. I just thought that my repo will be created automatically during the first push. I was so wrong.

    0 讨论(0)
  • 2020-11-29 14:53
    1. Open Git Bash.
    2. Change the current working directory to your local project.
    3. Initialize the local directory as a Git repository: $ git init
    4. Add the files in your new local repository. This stages them for the first commit: $ git add .
    5. Commit the files that you've staged in your local repository: $ git commit -m "First commit"
    6. At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL.
    7. In the Command prompt, add the URL for the remote repository where your local repository will be pushed : $ git remote add origin remote repository URL
    8. Push the changes in your local repository to GitHub: $ git push origin master
    0 讨论(0)
  • 2020-11-29 14:53

    Steps to upload project to git:-

    step1-open cmd and change current working directory to your project location.

    step2-Initialize your project directory as a Git repository.

    $ git init

    step3-Add files in your local repository.

    $ add .

    step4-Commit the files that you've staged in your local repository.

    $ git commit -m "First commit"

    step5-Copy the remote repository url.

    step6-add the remote repository url as origin in your local location.

    $ git add origin copied_remote_repository_url

    step7-confirm your origin is updated ot not.

    $ git remote show origin

    step8-push the changed to your github repository

    $ git push origin master.

    0 讨论(0)
  • 2020-11-29 14:54

    I think the easiest thing for you to do would be to install the git plugin for eclipse, works more or less the same as eclipse CVS and SVN plugins:

    http://www.eclipse.org/egit/

    GL!

    0 讨论(0)
  • 2020-11-29 14:54

    The best way to git is to actually start Gitting. Try out this website which makes you go step by step on what are the essential ways for performing functions on command line for pushing a Project on GitHub

    This is called try.github.io or you could also take up a course on codeAcademy

    0 讨论(0)
  • 2020-11-29 14:56

    Make sure that git is installed on your system. I'm explaining the process using windows OS

    Here is how I did :

    1.Open the cmd (you can do with git bash as well).

    2.Go to your project directory(where your project is located).

    3.Now type your_directory >git init this will initialize an empty repository if it is first time and enter. for eg :C:\Users>git init

    4.Now type your_directory >git add <filename>(if specific files) or git add . (if you want to add all files) and enter.

    5.Now type >git commit -m "commit message goes here" and enter.

    (in case if you need to check the status you can do by typing >git status) and enter.

    6.Now type >git remote add origin git_repository_url

    (check>git remote -v) and enter.

    7.Now turn to push it ...>git push origin master and enter

    (if you get error you push it forcefully by typing ...>git push -f origin master and enter.

    Now you're done with adding it to your repository. Refresh it and it will be there in your created repository.

    Hopefully, this will work for you.

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