- create an account on github
- create a repository on github
- make it private just in case if you need
- for private repository you need to pay 7$ per month
- now open command prompt
- change to the project's root directory and execute the following commands
- git init //The "init" command initiates a new git repository in the project directory.
- git remote add origin https://github.com/username/repositoryname.git //to add remote repository
- git add . //this adds all files to the local commit:
- git config --global user.email "userid@gmail.com"//email id configuration
- git config --global user.name "Name" //name configuration
- git commit -a -m "Initial commit" // initial commit
- (This stages your files locally for commit, but they have NOT actually been pushed yet. You've created a commit in your local repository, but not in the remote one. To put it on the remote, do:)
- git push -u origin --all
- the above command will open a dialog box in which login name name password are required to be submitted
- that's it...................
- if you get the errors while committing to the repository the do the following:
- git remote add origin https://github.com/javaiskool/struts.git
- git pull origin master
- git push -f origin master
- https://stackoverflow.com/questions/18328800/github-updates-were-rejected-because-the-remote-contains-work-that-you-do-not-h
- https://stackoverflow.com/questions/37937984/git-refusing-to-merge-unrelated-histories
Learn from github
No comments:
Post a Comment