Git Reference with short description and example
Git Reference with short description and example:
Initialize empty git repository:
> git init
Clone Command used to Create a working copy of a central repository:
> git clone <local machine path> <Directory URL>
** If you are already in the local machine path than ignore <local machine path> i.e. git clone <Directory URL>
Fetch Updated data from git repository:
> git pull
Add all modified files to the *current git stage:
> git add .
Add single modified file to the *current git stage:
> git add Filename/Path + Filename
** Note: if path or file name have blank space than use double quotes i.e. “Hello World”.ext or “Hello World”/filename.ext
Check “git status” for new change in *current git stage:
> git status
Remove file from *current git stage:
> git rm Filename/Path + Filename
Remove bulk files from *current git stage:
> git rm *.ext/Path + *.ext
If same extension and path then all files not require to add one by one i.e. git rm *.doc.
** Note: if path or file name have blank space then use double quotes i.e. “Hello World”.ext or “Hello World”/filename.ext
Commit data from *current git stage:
> git commit -m “add comments related to new changes”
Upload / Push data from *current git stage to live git repository
> git push
* Current git stage means local or live stage where you are working.
Thanks
Leave a Reply
You must be logged in to post a comment.