Skip to main content

Git Command's

 CMD GIT Command:-

Tell Who you are to GIT

git config -global user.name "mukul"

git config -global user.email "guptamukul806@gmail.com"

Push the code

cd Foldername   --> to jump into a folder.

cd.. --> move out of folder

git init --> initialize the code to git repository.

git add* --> add code to statging

git status --> check the status of file in code.

git add<filename> --> add individual file in staging 

git commit -m "commit message"--> all code is commit to git.

git remote add origin <server link>--> form the git connection to git hub server.

git push origin master--> code is pushed, if using first time then it will ask credential, the master is a branch name.

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

Pull the Code 

git clone <serverlink>  --> when first time user pull the code.

git pull origin master--> pull the code from git hub, and master is a branch name.

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

Play with git branch

git checkout -b develop --> make a new branch and copy master branch code in develop branch.

git branch--> to know in which branch you are working.

git checkout develop--> only check out the branch, and switch in eclipse, develop is branch.

git checkout master-->switch to master branch and check out master branch code

git merge develop --> first switch to master branch and then merge the maser branch to develop branch and now master branch code is up to date as was in develop code.



Comments