Adds

Friday, March 16, 2018

This is a Simple and Short GIT tutorial for beginners.




After installing GIT on your local machine, you should set up your identity (global not per repository):
git config --global user.name "Your Name"
git config --global user.email yname@email.com
to check your identity setting use:
git config user.name
git config user.email
To create new Local repository :
git init
which will create git repository in the current directory, or 
git init <project directory>
which will create git repository in the requested directory.
At any time to see the current state of repository use:
git status
Now we need to add all the existing code in the directory to the newly created repository:
git add *
or 
git add file1 file2 file3
to see what is in the staging area (about to be committed)
git diff --cached
or as discussed above 
git status
Which moves the code to the staging area (where we group items we want to commit). To commit those items:
git commit -m “commit message”
you can again check the status of the repository with 
git status
also, a useful command that shows the committed changes is:
git log
To see history of specific file 
git log file1
To see a graph representation of data
git log --graph --decorate --oneline
To check out code from remote location to your local repository:
git clone URL
Or 
git clone username@host:URL
To pull changes from remote repository to your local:
git pull
to push your local repository to master (remote)
git push origin master
to list branches:
git branch
to create new branch and switch to it
git checkout -b branchname
to switch to another branch
git checkout branchname
 
 
 
 
 
 
 
 
 



1 comment:

  1. Prospective buyers should also to|must also} be aware that the 3D-printing business is in a relentless state of upheaval. MakerBot, which was lengthy thought of the frontrunner amongst residence 3D printers, stopped advertising to hobbyists and home users a number of} years ago so Pencil Sharpener Electric as to to} consideration to} commercial and educational institutions. Many of the printers we now have examined have come and gone throughout the span of a year or two.

    ReplyDelete