Home
/
Advanced Site Tools
/
Git
/
How to manage your Git repository?

How to manage your Git repository?

Use the commands below via SSH to manage your repository:

  • mkdir GIT – creates a folder named GIT
  • cd GIT – enter the GIT folder
  • git init – initialize a GIT repository
  • touch filename.php – create an empty file named filename.php, substitute filename.php with the actual filename
  • git status – compare the list of files in the actual GIT repository and the list of current files you have created
  • git add filename.php – add the filename.php to the GIT repository index
  • git commit -m ‘first commit’ – push changes to the repository, substitute first commit with the actual commit label
  • git remote add origin git@github.com:your_username/name_of_your_repo.git – push changes to a remote GIT repo. Substitute your_username and name_of_your_repo with your actual GitHub username and the name of your repository
  • git push origin master – push the changes to the GitHub repository

Share This Article