Following are the steps to add projects to github . Though i have written this for eclipse projects, actually this works for any projects.
1. I assume you are having git installed in your pc, else first download and and install git from here .
2. Browse to your project folder and type
3. Now let git know where you want to send your content. Type the following
$ git remote add origin https://github.com/[GIT user id]/[projectName].git
4. Now that git knows where you want to send your project , another 3 simple things you have to do. Add the actual project, commit to local git and finally replicate the change to github.
git add . # this adds all the files
git commit -a -m "Initial commit" # this is for local commit.
git push -u origin --all # finally :)
5. Remember git will ask for your github user id and password.
Here are simple steps (only commands) to install ,setup a repo and commit to github . I assume that you are having root access(These instructions are from linux only. ) and a github account .
- Go to the folder containing code , which you want to commit.
- sudo apt-get install git # install git
- Next step is to setup github with your detailsmonai@monai:~/imraw$ git config –global user.name “Your name”
$ git config –global user.email ” your mail ”
$ git config –global credential.helper cache # to remember password
- Next step is to add files to repo
git add *
- Now we are ready to commmit changes
git commit *
- In case you get any fatal error regarding creation of index.lock , userm -f ./.git/index.lock
- Now we are ready to push our changes to github.com
$ git remote add origin https://github.com/yourname/projectname.git
$ git push origin master
- That’s it. Remember you can always use force , in case you encounter some error and you know the system is wrong 🙂