Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 2.35 KB

introduction.md

File metadata and controls

78 lines (60 loc) · 2.35 KB

Introduction

 

Step #1: Git initialization

user@machine:~$ git init    # Note: Initialized empty Git repository in ~PATH/.git/

 

Step #2: Adding files, and directories into Git

user@machine:~$ git add anyName.txt anyName.sh anyName.py DeepLearning MachineLearning Bioinformatics NLP     # Note: Adding One-by-One
user@machine:~$ git add *    # Note: Or, we can use "git add ."; we can add all {files, directories} at the same times.

 

Step #3: Remove files, and directories from Git

user@machine:~$ git add rm --cached anyName.txt anyName.sh anyName.py DeepLearning MachineLearning Bioinformatics NLP    # Note: Remove One-by-one
user@machine:~$ git add rm --cached *    # Note: Remove all Together

 

Step #4: Check current status

user@machine:~$ git status    # Note: We can monitor current condition of files and directories.

 

Step #5: Git commit

user@machine:~$ git commit -m 'Write Something' # Note: Save the files and directories.

 

Step #6: Prepare to Send ( Push ) Information to GitHub

user@machine:~$ git remote add origin https://github.com/anyUserName/anyName.git    # Trying to access remotely GitHub repository
user@machine:~$ git remote rm origin    # Fix the fatal err when trying to access remotely GitHub repository

 

Step #7: Push information to GitHub (Local PC --> GitHub)

user@machine:~$ git push -u origin master --force # Note: Dangerious Commands, remote all existances and add new.

 

Step #8: Rename Files

user@machine:~$ git mv <OLD> <NEW>
user@machine:~$ git add <NEW> # (Optional)
user@machine:~$ git commit --message='Track Changes'
  • Step #8.1: Rename and Replace with Same File

    • Step #1: Move, Add, Commit
      user@machine:~$ git mv f11.py fg12.py
      user@machine:~$ git add fg12.py # (Optional)
      user@machine:~$ git commit --message='We renamed the file (f11.py --> fg12.py)'
    • Step #2: Replace the 'fg12.py' with 'fg12.py'
    • Step #3: Add, Commit
      user@machine:~$ git add fg12.py # (Optional)
      user@machine:~$ git commit --message='We renamed the file (f11.py --> fg12.py)'
  • Note: Reference: https://www.patrick-wied.at/blog/rename-files-and-folders-with-git