Thursday, December 15, 2016

steps to add project to git repo locally

Note: In the below step , I have used a project named "my_project"  . Install git and create a account in github before follow the below steps.

Github Link : https://github.com/

In Ubuntu flavoured system :

sudo apt-get install git

My project directory is :

/home/cision/project/my_project>



  1.  cd /home/cision/project/my_project>
  2. git config --global user.name 'username'
  3. git config --global user.email 'your registered emails id in github'
  4. git init
  5. git add -A
  6. git status 
  7. git commit -m "initialize repository'
safeguard : In case any damage in local project directory ( not the git repository ) use th ebelow command to restore from git to project directory 

Ex: remove any file from project directory , then 

# git checkout -f

Now you can see the same deleted file again in the project directory.








No comments:

Post a Comment