If you need to remove files from a repo after committing, use …
Remove file
git rm --cached file.ext |
Push to repo
git push |
cloud engineer
If you need to remove files from a repo after committing, use …
Remove file
git rm --cached file.ext |
git rm --cached file.ext
Push to repo
git push |
git push
Here’s how to reset a file from the master branch.
git checkout origin/master test.py |
git checkout origin/master test.py
This will undo your changes and matches what’s in the master repo.
If you have trouble cloning a github repo using https, you can tell it to switch to SSH instead.
Here’s the command.
git config --global url.ssh://git@github.com/.insteadOf https://github.com/ |
git config --global url.ssh://git@github.com/.insteadOf https://github.com/
I had to specify reconfigure when I ran terraform init.
terraform init --reconfigure |
terraform init --reconfigure
Steps how to install Docker and Docker Compose on Amazon Linux 2.
Install Docker
$ sudo amazon-linux-extras install docker $ sudo service docker start $ sudo usermod -a -G docker ec2-user |
$ sudo amazon-linux-extras install docker $ sudo service docker start $ sudo usermod -a -G docker ec2-user
Start at boot.
$ sudo chkconfig docker on |
$ sudo chkconfig docker on
Install git (optional).
$ sudo yum install -y git |
$ sudo yum install -y git
Install Docker Compose
$ sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) \ -o /usr/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose |
$ sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) \ -o /usr/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose
Check
docker --version docker-compose --version |
docker --version docker-compose --version
How to clone repositories with multiple Github accounts.
git clone git@github.com-yourgitaccount:yourgitaccount/myrepo.git |
git clone git@github.com-yourgitaccount:yourgitaccount/myrepo.git