Saturday, February 9, 2019

Version Control: GIT basic Commands in Linux


 GIT basic Commands in Linux


https://rubygarage.org/blog/most-basic-git-commands-with-examples
~~~~~~~~~~Clone Repository~~~~~~~~~~~~~~~
cd Documents
git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~give new name to your repository~~~~~~~~~~~~~~
git remote add gitPython https://github.com/j-thepac/Python_snippets.git #set git
cd to git folder
git remote
-------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~Add new file into Git repository~~~~~~~~~~~~~~~

git add file #staging area ready to commit
#git add --all # to add all files to staging area
git status
git commit
#enter the title of the file
git push #push it to current version
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~Remove files from stagin area~~~~~~~~~~~~~
git rm --cached my-file.ts # remove file from staging area
#git reset
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
git mv [file-original] [file-renamed] # rename file

No comments:

Post a Comment