Git is use for VCS ( Version Control System). To use for records changes to a file or set of files over time so that you can recall specific versions according to programmer requirement.
Git allow you to revert files back to a previous state , revert the entire project back to a previous state , and also compare changes over time , you also able to see who last modified the code in file or any changes.
Here i write some most important and basic command of Git for Beginner Git User.
1. How to install Git in Ubuntu ?
--------------------------------------------------------------
/$ sudo apt-get update
/$ sudo apt-get install git
--------------------------------------------------------------
2. How to Set Up Git ?
--------------------------------------------------------------
/$ git config --global user.name "Your Name"
/$ git config --global user.email "youremail@domain.com"
----------------------------------For see all Configuration--------------------
/$ git config --list
-------------------------------------------------------------------------------------------------
Now this is some Basic Git Commands .
a) For create a new local repository
=> git init
b) Create a working copy of a local repository
=> git clone /path/to/repository
C) For a remote server, use
=> git clone username@host: /path/to/repositroy
d) Add files (one or more files)
=> git add <filename>
e) Commit directory for local changes.
=> git commit -m "commit message"
f) Send changes to master branch of your remote repositor.
=> git push origin master
g) List the file you've changed in local branch and those you still need to add or commit.
=> git status
h) If you haven't connected you local repository to a remote server , then use this command to add the server to be able to push to it.
=> git remote add origin <server>
i) List all currently configured remote repositories:
=> git remote -v
*Switch from one branch to another:
=> git checkout <branchname>
*For create a new branch.
=> git checkout -b <branchname>
*For check you current branch
=> git branch
*For delete the branch
=> git branch -d <branchname>
*Push all branches to your remote repository.
=> git push --all origin
j) Update your remote repository.
=> git pull
===================================
This is some use full and very basic command of git .
Git allow you to revert files back to a previous state , revert the entire project back to a previous state , and also compare changes over time , you also able to see who last modified the code in file or any changes.
Here i write some most important and basic command of Git for Beginner Git User.
1. How to install Git in Ubuntu ?
--------------------------------------------------------------
/$ sudo apt-get update
/$ sudo apt-get install git
--------------------------------------------------------------
2. How to Set Up Git ?
--------------------------------------------------------------
/$ git config --global user.name "Your Name"
/$ git config --global user.email "youremail@domain.com"
----------------------------------For see all Configuration--------------------
/$ git config --list
-------------------------------------------------------------------------------------------------
Now this is some Basic Git Commands .
a) For create a new local repository
=> git init
b) Create a working copy of a local repository
=> git clone /path/to/repository
C) For a remote server, use
=> git clone username@host: /path/to/repositroy
d) Add files (one or more files)
=> git add <filename>
e) Commit directory for local changes.
=> git commit -m "commit message"
f) Send changes to master branch of your remote repositor.
=> git push origin master
g) List the file you've changed in local branch and those you still need to add or commit.
=> git status
h) If you haven't connected you local repository to a remote server , then use this command to add the server to be able to push to it.
=> git remote add origin <server>
i) List all currently configured remote repositories:
=> git remote -v
*Switch from one branch to another:
=> git checkout <branchname>
*For create a new branch.
=> git checkout -b <branchname>
*For check you current branch
=> git branch
*For delete the branch
=> git branch -d <branchname>
*Push all branches to your remote repository.
=> git push --all origin
j) Update your remote repository.
=> git pull
===================================
This is some use full and very basic command of git .
No comments:
Post a Comment