Feb.08

Git Commands

Git Initialize

——————————

To initialize a git repository in the root of the folder, run the git init command: $ git init Commiting Specific file : what is commit command  $git add -A – $ git add <filename> [add specified file] – $git add -A [add all files in to repository] Show the changes status of file

 

————————————–

D:\ > $ git status  

D:\ > $ git status  :: Create a new branch::

——————————-

 

$ git checkout <my branch name>

$ git checkout -b <my branch name> [create new branch as name specified] ‘$ git checkout <my branch name>  [go to specified branch ] go back to master repository

 

—————————————

$ git checkout master 

$ git checkout master See whethere branch is created or not you can use the git branch command to confirm that your branch was created:

——————————————

$ git branch  

$ git branch

Create a new repository on GitHub

———————————-

create online repository in github site copy this repository link https://github.com/PrakashKumarBhandari/testproject.git See log

————————-

$git log $git log — graph [show log in graph]

$git log  push an existing repository from the command line’ section: into github site

————————————————————–

$ git remote add origin https://github.com/PrakashKumarBhandari/testproject.git push local repository master content in to online repository location :

 

——————————————-

Git Pull Fetch from and Integrate with another repository or a local branch.

$git pull [options] [<repository> [<refspec>…​]]

$git pull origin master

 

———————————————

Git Add changes (modified) local file

+++++++++++++++++++++++++++

Stage your changes

Git has a staging area, for files that you want to commit. On GitHub when you edit a file, you commit it as soon as you save it. On your machine, you can edit a number of files and commit them altogether.

Staging a file in Git’s terminology means adding it to the staging area, in preparation for a commit.

Add your amended file to the staging area:

$git add <filename>
Ex: $git add attendees_and_learners.rst


-----------------------------

Commit your changes

+++++++++++++++++++++++++++++
git commit -m "added my github name"

When you’re happy with your files, and have added the changes you want to commit to the staging area:

 

-----------------------------

Merge from branch

+++++++++++++++++++++++++++++

example branch is ratcv2 which is need to merge in to master branch.

1. Admin@Admin-PC MINGW64 /f/new (master)
$ git merge ratcv2

 

2. Admin@Admin-PC MINGW64 /f/new (master|MERGING)
$ git add -A

 

3. Admin@Admin-PC MINGW64 /f/new (master|MERGING)
$ git commit -m “download files – from branch”

this command will merge ratcv2 updates in to master if any conflict arises it has to be fixed before

……………………………………………..

Aborting Merge for branch:

—————————————

git merge –abort

 

 

—————————————–

 Push your changes to GitHub

++++++++++++++++++++++++

When you made a change on GitHub, it not only saved the change and committed the file at the same time, it also showed up right away in your GitHub repository. Here there is an extra step: we need to push the files to GitHub.

If you were pushing changes from master locally to master on GitHub, you could just issue the command git push and let Git work out what needs to go where.

It’s always better to be explicit though. What’s more, you have multiple branches here, so you need to tell git where to push (i.e. back to the remote repository you cloned from, on GitHub) and what exactly to push (your new branch).

The repository you cloned from – yours – can be referred to as origin. The new branch is called amend-my-name. So:

$ git push origin amend-my-name

 

$ git push -u origin master

$ git push -u origin master Push a branch to GitHub

———————————————

$ git push origin <yourbranchname>

$ git push origin master [ push in to master repo or we can push into created branch ]

Copy and Rename file


 

Installing and set up process of Laravel projects

+++++++++++++++++++++++++++++++++++++++++++++++

change .env.example file to .env file $ cp .env.example .env now set up you database connection configuration — of .env file DB_HOST=localhost DB_DATABASE=ribbon DB_USERNAME=root DB_PASSWORD= +++++++++++++++++++++++++++++++++++++

Run composer

 

———————————–

$ composer install

+++++++++++++++++++++++++++++++++++++++

Migrate Database

————————————-

$ php artisan migrate

++++++++++++++++++++++

Seed database : $php artisan db:seed

Share this Story:
  • facebook
  • twitter
  • gplus

Leave a comment

Facebook Comment