GIT (CLI)
INSTALLATION
PS C:\> Invoke-WebRequest https://git-scm.com/downloads/win -OutFile .\Downloads\Git-2.49.0-64-bit.exe
PS C:\> .\Git-2.49.0-64-bit.exe
* ALT: BROWSER > https://git-scm.com/downloads >
* Follow guided installation
RENAMING DIRECTORIES
git:~$ git clone https://github.com/username/repository.git
git:~$ cd repository
* this cmd clones the directory
git:~$ git mv old_directory_name new_directory_name
* this cmd renames the specified directory
git:~$ git commit -m "Renamed directory from old_directory_name to new_directory_name"
* this cmd commits the changes
git:~$ git push origin main
* this cmd pushes the changes
DELETING FILES
git:~$ cd path/to/your/repository
git:~$ git rm file_name
* ALT: delete the file from the repository but keep it in the local system
git rm --cached file_name
git:~$ git commit -m "Delete file_name"
git:~$ git push origin main
CREATING DIRECTORIES
git:~$ cd path/to/your/repository
git:~$ mkdir new_directory_name
#stage the changes
git:~$ touch new_directory_name/.gitkeep
* git doesn't track empty directories. add a placeholder file (.gitkeep) in the new directory to ensure it is tracked
git:~$ git add new_directory_name/.gitkeep
git:~$ git commit -m "Create new_directory_name"
git:~$ git push origin main
Last updated