Thursday 13 August 2015

Git commands


Create local repository:
-----------------------
mkdir <repository name>
cd <repository name>
git init --bare

Create working directory:
------------------------
mkdir <directory name>
cd <directory name>
git init

Committing file:
---------------
1. git add <filename>
If it is a new folder(my_project) and its contents:
a) git add my_project
b) git add my_project/*
2. git commit -m "<mesage>"
a) git commit -a [To commit all modified and deleted and newly added files]
3. git remote add origin <remote repository URL>
git remote -v
4. git push <filename>
a) git push <origin> master

See all the files in repository:
-------------------------------
git ls-tree --full-tree -r HEAD

Cloning a repository:
--------------------
git clone <repository URL>

2 comments: