In following tip we’ll walk down with few steps to upload your rails Project to Github.
Create your free github account @ Github
Configuration in Github account :
Create a new repository in your Github account: repository_name
Enter your repository name: give_any_name
Provide a short description regarding your project (optional) & and choose public type repository.
Now click on Create Repository Button & just copy the link (#) which will be used with git remote add origin in cmd prompt.
Now let’s move to our project directory via cmd/terminal window & setup git :
( I am assuming git setup is done @ your machine)
Configuration via CMD Prompt:
$ cd Myapp
#Let's initialize required Git Files and initialize an empty repository .git inside your project directory .
myapp/ $ git init
=>Initialized empty Git repository in C:/project/myfirstapp-master/.git/
# Let's add our project along with the files to be committed :
# Enter git then add then a space and dot (.) (space before the final dot is important)
$ git add .
#Let's commit the changes and add a message notifying the same :
$ git commit -m 'peforming a first commit to git"
#In order to connect local repository to our github account we need to set a remote for repository & push our commits to it. (get link from # section)
$ git remote add origin https://github.com/user_name/repository_name.git
#It's time to push the commits :
$ git push -u origin master
#It will prompt you to enter your Git username & password
Username for 'https://github.com': git_user_name
Password for 'https://firstname.lastname@example.org': git_password
#Now just check your codes are already pushed to github,follow the link to your repository :