Git Tutorial
Git Useful Resources
Selected Reading
- Git - Online Repositories
- Git - Different Platforms
- Git - Handling Conflicts
- Git - Managing Branches
- Git - Patch Operation
- Git - Tag Operation
- Git - Fix Mistakes
- Git - Delete Operation
- Git - Rename Operation
- Git - Move Operation
- Git - Stash Operation
- Git - Update Operation
- Git - Push Operation
- Git - Commit Changes
- Git - Review Changes
- Git - Perform Changes
- Git - Clone Operation
- Git - Create Operation
- Git - Life Cycle
- Git - Environment Setup
- Git - Basic Concepts
- Git - Home
Git Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Git - Delete Operation
Git - Delete Operation
Tom updates his local repository and finds the compiled binary in the src directory. After viewing the commit message, he reapzes that the compiled binary was added by Jerry.
[tom@CentOS src]$ pwd /home/tom/project/src [tom@CentOS src]$ ls Makefile string_operations string_operations.c [tom@CentOS src]$ file string_operations string_operations: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically pnked (uses shared pbs), for GNU/Linux 2.6.18, not stripped [tom@CentOS src]$ git log commit 29af9d45947dc044e33d69b9141d8d2dad37cc62 Author: Jerry Mouse <jerry@tutorialspoint.com> Date: Wed Sep 11 10:16:25 2013 +0530 Added compiled binary
VCS is used to store the source code only and not executable binaries. So, Tom decides to remove this file from the repository. For further operation, he uses the git rm command.
[tom@CentOS src]$ ls Makefile string_operations string_operations.c [tom@CentOS src]$ git rm string_operations rm src/string_operations [tom@CentOS src]$ git commit -a -m "Removed executable binary" [master 5776472] Removed executable binary 1 files changed, 0 insertions(+), 0 deletions(-) delete mode 100755 src/string_operations
After commit, he pushes his changes to the repository.
[tom@CentOS src]$ git push origin master
The above command will produce the following result.
Counting objects: 5, done. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 310 bytes, done. Total 3 (delta 1), reused 0 (delta 0) To gituser@git.server.com:project.git 29af9d4..5776472 master −> masterAdvertisements