Pages

How to push code to github

Adding an existing project to GitHub using the command line, Putting your existing work project on GitHub can let you share and collaborate in lots of best ways.

What is GITHUB ?
   
      GitHub is a Git repository hosting service, but it adds many of its own features. While Git is a command line tool, GitHub provides a Web-based graphical interface. It also provides access control and several collaboration features, such as a wikis and basic task management tools for every project.

CREATE New Repository to git and push project from local directory

STEP 1 :  Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files.

You can add these files after your project has been pushed to GitHub from local project.

STEP 2 :  Open Terminal.
           
Change the current working directory to your local project.
       
Initialize the local directory as a Git repository.
$ git init
STEP 3 :  Add the files in your new local repository. This stages them for the first commit.
$ git add . 
STEP 4 : Can check modified files list for following.
$ git status

STEP 5 : Adds the files in the local repository and stages them for commit.
$ git commit -m "initial commit"


STEP 6: Adds remote repository URL to your local project.
$ git remote add origin -m master remote repository URL
Example : 

$ git remote add origin -m master https://github.com/ghanshyamnakiya/laravel.git

STEP 7: Push the changes in your local repository to GitHub.
 $ git push -u origin master
Note : here will ask the github Username and Password when push project to GitHub.



No comments:

Post a Comment

Popular Posts