Thursday, 8 May 2014

HOW TO PUSH A SIMPLE APPLICATION IN TO GITHUB

  HOW TO PUSH A SIMPLE APPLICATION INTO GITHUB

Step 1: First create a new rails application in your local system.
EX: I was created one application in projrcts folder i.e, ~/projects/deviseauth
Step 2: Open the terminal and go to your application location.
ctrl+alt+t -------> To open the terminal
@ubuntu:~$cd projects
@ubuntu:~/projects$ cd deviseauth
Step 3: Initialize empty git repository.
@ubuntu:~/projects/deviseauth$ git init
you will see fallowing text on terminal.
Initialized empty Git repositoryin ~/projects/deviseauth/.git/
Step 4: To add all subsequent resources(on which you have made changes) under that folder to GIT's version control for commit.
@ubuntu:~/projects/deviseauth$ git add.
Step 5: To commit all the changes
syntax: $ git commit -m "simple message"
@ubuntu:~/projects/deviseauth$ git commit -m "new rails app"
Step 6:Go to your github account and create a new repositary give a name here my repositary name is “deviseauth”.
Step 7:
Syntax: $ git remote add [any name] [ path of remote repo]
git remote add is to add a "short name", such as origin, and it can be any name as well, which is like an alias to a URL. And origin is the usual path of where the remote repo points to.
@ubuntu:~/projects/deviseauth$ git remote add origin https://github.com/sarithachakilala/deviseauth.git
Step 8:To push your application to github
@ubuntu:~/projects/deviseauth$ git push -u origin master
It will ask your github account username and password.
[Note: The push operation is performed when the total work of your remote contains locally otherwise it gives fallowing error message. Error:failed to push some refs to 'https://github.com/sarithachakilala/deviseau hint: Updates were rejected because the remote contains work that you do nt have locally.]
At that time you need to perform step 9.
Step 9:Pull your remote work to your local application.
@ubuntu:~/projects/deviseauth$ git pull origin master
Step 10: Then try to perform push operation using step 8. It will works fine.


*********************HAPPY RAILS CODING****************

No comments:

Post a Comment