Thursday, 18 January 2018

Git Commands for Config

Git Commands for Config

git init
git config --global user.name "prasad"
git config --global user.email "prasad@gmail.com"

git config --list

Adding new file:
git add <filename>
git add .

git commit -m "Nagaraj Test1"
git commit -m "Nagaraj Test2"


git log
git log -n <number> ( list in first )

------------
md central
cd central
git init --bare --shared


----
In work directory (copy the path from central folder)
git push c:\central master


cd central
git log
===========================

git branch  (To list all branches)

git branch <newbranchName>
git branch <branchName>
git branch master-1
get branch
ls

Swap to another Branch:
git checkout <branchname>
git checkout master-1
git checkout master
get merge master-1

Remove Branch:
git branch -d <branchName>   This command need to execute from parent.
ex: git branch -d master-1

Create a New Branch and move to that Branch:
git checkout -b branch-2
( It will be created and move the cursor into that branch )
To List out: git branch

git clone https://github.com/polarapu/batch-10.git
cd batch-10
touch name
git add .
git commit -m "name"
git push

git pull

git show shacode

No comments:

Post a Comment