AI Dashboard is available on the Web, Apple, Google, and Microsoft, PRO version
What is Git Cherry-Picking?
Cherry picking in git means to choose a commit from one branch and apply it onto another.
This is in contrast with other ways such as merge and rebase which normally apply many commits onto another branch. In other words, cherry-picking is when you want to take the contents of a single commit from another branch and copy-paste them to a destination branch as a brand new commit.
Quick Summary of Git Cherry-picking steps
- Find the commit hash you want to cherry-pick.
- Go to your destination branch.
- git cherry-pick -x commit-hash
- Resolve conflicts if they occur.
- If there are notes in the original commit, copy them over.
Detailed Git Cherry-picking process
- From the origin branch where you want to cherry pick from, run this command to get the commit has needed:
<code
git reflog
.</code
- Make sure you are on the branch you want to apply the commit to.
git checkout
Execute the following for the typical cherry-pick command is simply:
git cherry-pick commit-hash
As developers, we often perform a series of steps to achieve our objectives. Showing you an isolated cherry-pick command is the same as throwing you the manual and asking you to read it. - If you cherry-pick from a public branch, you should consider using
git cherry-pick -x commit-hash
This will generate a standardized commit message. This way, you (and your co-workers) can still keep track of the origin of the commit and may avoid merge conflicts in the future. - If you have notes attached to the commit they do not follow the cherry-pick. To bring them over as well, You have to use:
git notes copy from_commit_hash to_commit_hash
References:
revert a file to a specific commit using git
AI Dashboard is available on the Web, Apple, Google, and Microsoft, PRO version
How to git revert a file to a specific commit using git
Assuming your commit id is 8a02c028
git checkout 8a02c028 -- file1/to/restore file2/to/restore
Git Cheat Sheet
AI Dashboard is available on the Web, Apple, Google, and Microsoft, PRO version
Find Useful Git commands in this Git Cheat Sheet.
Here is a basic Git cheat sheet:
git init
– Initialize a new git repository
git clone [repository]
– Clone an existing repository
git status
– Check the status of your repository
git add [file]
– Add a file to the repository
git commit -m "[message]"
– Commit changes with a message
git push
– Push changes to a remote repository
git pull
– Pull changes from a remote repository
git branch
– Show the current branch
git branch [branch-name]
– Create a new branch
git checkout [branch-name]
– Switch to a different branch
git merge [branch-name]
– Merge a branch into the current branch
git log
– Show the commit history
git diff
– Show changes between commits
git reset --hard [commit]
– Reset repository to a specific commit
git stash
– Stash changes
git stash apply
– Apply stashed changes
Please note that this is a basic cheat sheet and git has many more functionalities and options, it is worth reading the git documentation to learn more.
- Clone a project:
git clone git_repo_url project_name - Switch to a branch locally:
git checkout branch_name - Modify a file, then save and push it to remote repo in current branch
git add path_to_file_modifeid/file_name
git commit -m “Description of modification”
git push - Get a new version of a file after modifying local version
git checkout path_to_file_modified/file_modified - Get latest version of current branch
git fetch
git pull
if you have local changes, you will be prompted to commit or stash them before pulling.
- Create a new branch based on current branch and switch to it
git checkout –b branch_name - Switch to master branch
git checkout master - Merge branch_name to master
git merge branch_name - Delete local branch
git branch -d branch_name - Undo a merge or pull
git reset –hard - Undo a commit locally and on the remote branch
git reset –hard commit_id
git push –force - Get remote url of a local branch
git remote show origin
Active Hydrating Toner, Anti-Aging Replenishing Advanced Face Moisturizer, with Vitamins A, C, E & Natural Botanicals to Promote Skin Balance & Collagen Production, 6.7 Fl Oz
Age Defying 0.3% Retinol Serum, Anti-Aging Dark Spot Remover for Face, Fine Lines & Wrinkle Pore Minimizer, with Vitamin E & Natural Botanicals
Firming Moisturizer, Advanced Hydrating Facial Replenishing Cream, with Hyaluronic Acid, Resveratrol & Natural Botanicals to Restore Skin's Strength, Radiance, and Resilience, 1.75 Oz
Skin Stem Cell Serum
Smartphone 101 - Pick a smartphone for me - android or iOS - Apple iPhone or Samsung Galaxy or Huawei or Xaomi or Google Pixel
Can AI Really Predict Lottery Results? We Asked an Expert.
Djamgatech
Read Photos and PDFs Aloud for me iOS
Read Photos and PDFs Aloud for me android
Read Photos and PDFs Aloud For me Windows 10/11
Read Photos and PDFs Aloud For Amazon
Get 20% off Google Workspace (Google Meet) Business Plan (AMERICAS): M9HNXHX3WC9H7YE (Email us for more)
Get 20% off Google Google Workspace (Google Meet) Standard Plan with the following codes: 96DRHDRA9J7GTN6(Email us for more)
FREE 10000+ Quiz Trivia and and Brain Teasers for All Topics including Cloud Computing, General Knowledge, History, Television, Music, Art, Science, Movies, Films, US History, Soccer Football, World Cup, Data Science, Machine Learning, Geography, etc....
List of Freely available programming books - What is the single most influential book every Programmers should read
- Bjarne Stroustrup - The C++ Programming Language
- Brian W. Kernighan, Rob Pike - The Practice of Programming
- Donald Knuth - The Art of Computer Programming
- Ellen Ullman - Close to the Machine
- Ellis Horowitz - Fundamentals of Computer Algorithms
- Eric Raymond - The Art of Unix Programming
- Gerald M. Weinberg - The Psychology of Computer Programming
- James Gosling - The Java Programming Language
- Joel Spolsky - The Best Software Writing I
- Keith Curtis - After the Software Wars
- Richard M. Stallman - Free Software, Free Society
- Richard P. Gabriel - Patterns of Software
- Richard P. Gabriel - Innovation Happens Elsewhere
- Code Complete (2nd edition) by Steve McConnell
- The Pragmatic Programmer
- Structure and Interpretation of Computer Programs
- The C Programming Language by Kernighan and Ritchie
- Introduction to Algorithms by Cormen, Leiserson, Rivest & Stein
- Design Patterns by the Gang of Four
- Refactoring: Improving the Design of Existing Code
- The Mythical Man Month
- The Art of Computer Programming by Donald Knuth
- Compilers: Principles, Techniques and Tools by Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman
- Gödel, Escher, Bach by Douglas Hofstadter
- Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin
- Effective C++
- More Effective C++
- CODE by Charles Petzold
- Programming Pearls by Jon Bentley
- Working Effectively with Legacy Code by Michael C. Feathers
- Peopleware by Demarco and Lister
- Coders at Work by Peter Seibel
- Surely You're Joking, Mr. Feynman!
- Effective Java 2nd edition
- Patterns of Enterprise Application Architecture by Martin Fowler
- The Little Schemer
- The Seasoned Schemer
- Why's (Poignant) Guide to Ruby
- The Inmates Are Running The Asylum: Why High Tech Products Drive Us Crazy and How to Restore the Sanity
- The Art of Unix Programming
- Test-Driven Development: By Example by Kent Beck
- Practices of an Agile Developer
- Don't Make Me Think
- Agile Software Development, Principles, Patterns, and Practices by Robert C. Martin
- Domain Driven Designs by Eric Evans
- The Design of Everyday Things by Donald Norman
- Modern C++ Design by Andrei Alexandrescu
- Best Software Writing I by Joel Spolsky
- The Practice of Programming by Kernighan and Pike
- Pragmatic Thinking and Learning: Refactor Your Wetware by Andy Hunt
- Software Estimation: Demystifying the Black Art by Steve McConnel
- The Passionate Programmer (My Job Went To India) by Chad Fowler
- Hackers: Heroes of the Computer Revolution
- Algorithms + Data Structures = Programs
- Writing Solid Code
- JavaScript - The Good Parts
- Getting Real by 37 Signals
- Foundations of Programming by Karl Seguin
- Computer Graphics: Principles and Practice in C (2nd Edition)
- Thinking in Java by Bruce Eckel
- The Elements of Computing Systems
- Refactoring to Patterns by Joshua Kerievsky
- Modern Operating Systems by Andrew S. Tanenbaum
- The Annotated Turing
- Things That Make Us Smart by Donald Norman
- The Timeless Way of Building by Christopher Alexander
- The Deadline: A Novel About Project Management by Tom DeMarco
- The C++ Programming Language (3rd edition) by Stroustrup
- Patterns of Enterprise Application Architecture
- Computer Systems - A Programmer's Perspective
- Agile Principles, Patterns, and Practices in C# by Robert C. Martin
- Growing Object-Oriented Software, Guided by Tests
- Framework Design Guidelines by Brad Abrams
- Object Thinking by Dr. David West
- Advanced Programming in the UNIX Environment by W. Richard Stevens
- Hackers and Painters: Big Ideas from the Computer Age
- The Soul of a New Machine by Tracy Kidder
- CLR via C# by Jeffrey Richter
- The Timeless Way of Building by Christopher Alexander
- Design Patterns in C# by Steve Metsker
- Alice in Wonderland by Lewis Carol
- Zen and the Art of Motorcycle Maintenance by Robert M. Pirsig
- About Face - The Essentials of Interaction Design
- Here Comes Everybody: The Power of Organizing Without Organizations by Clay Shirky
- The Tao of Programming
- Computational Beauty of Nature
- Writing Solid Code by Steve Maguire
- Philip and Alex's Guide to Web Publishing
- Object-Oriented Analysis and Design with Applications by Grady Booch
- Effective Java by Joshua Bloch
- Computability by N. J. Cutland
- Masterminds of Programming
- The Tao Te Ching
- The Productive Programmer
- The Art of Deception by Kevin Mitnick
- The Career Programmer: Guerilla Tactics for an Imperfect World by Christopher Duncan
- Paradigms of Artificial Intelligence Programming: Case studies in Common Lisp
- Masters of Doom
- Pragmatic Unit Testing in C# with NUnit by Andy Hunt and Dave Thomas with Matt Hargett
- How To Solve It by George Polya
- The Alchemist by Paulo Coelho
- Smalltalk-80: The Language and its Implementation
- Writing Secure Code (2nd Edition) by Michael Howard
- Introduction to Functional Programming by Philip Wadler and Richard Bird
- No Bugs! by David Thielen
- Rework by Jason Freid and DHH
- JUnit in Action
#BlackOwned #BlackEntrepreneurs #BlackBuniness #AWSCertified #AWSCloudPractitioner #AWSCertification #AWSCLFC02 #CloudComputing #AWSStudyGuide #AWSTraining #AWSCareer #AWSExamPrep #AWSCommunity #AWSEducation #AWSBasics #AWSCertified #AWSMachineLearning #AWSCertification #AWSSpecialty #MachineLearning #AWSStudyGuide #CloudComputing #DataScience #AWSCertified #AWSSolutionsArchitect #AWSArchitectAssociate #AWSCertification #AWSStudyGuide #CloudComputing #AWSArchitecture #AWSTraining #AWSCareer #AWSExamPrep #AWSCommunity #AWSEducation #AzureFundamentals #AZ900 #MicrosoftAzure #ITCertification #CertificationPrep #StudyMaterials #TechLearning #MicrosoftCertified #AzureCertification #TechBooks
Top 1000 Canada Quiz and trivia: CANADA CITIZENSHIP TEST- HISTORY - GEOGRAPHY - GOVERNMENT- CULTURE - PEOPLE - LANGUAGES - TRAVEL - WILDLIFE - HOCKEY - TOURISM - SCENERIES - ARTS - DATA VISUALIZATION
Top 1000 Africa Quiz and trivia: HISTORY - GEOGRAPHY - WILDLIFE - CULTURE - PEOPLE - LANGUAGES - TRAVEL - TOURISM - SCENERIES - ARTS - DATA VISUALIZATION
Exploring the Pros and Cons of Visiting All Provinces and Territories in Canada.
Exploring the Advantages and Disadvantages of Visiting All 50 States in the USA
Health Health, a science-based community to discuss health news and the coronavirus (COVID-19) pandemic
- CDC issues alert over rising measles cases in the U.S.by /u/nbcnews on March 19, 2024 at 1:49 am
submitted by /u/nbcnews [link] [comments]
- 8-hour time-restricted eating linked to a 91% higher risk of cardiovascular deathby /u/ethereal3xp on March 19, 2024 at 1:22 am
submitted by /u/ethereal3xp [link] [comments]
- Intermittent Fasting Linked to Heart Risks in Research Surpriseby /u/hawlc on March 18, 2024 at 11:58 pm
submitted by /u/hawlc [link] [comments]
- Families cutting back on healthy food risks widening health inequalitiesby /u/boppinmule on March 18, 2024 at 9:18 pm
submitted by /u/boppinmule [link] [comments]
- People with ‘Havana Syndrome’ show no brain damage or medical illnessby /u/scientificamerican on March 18, 2024 at 8:48 pm
submitted by /u/scientificamerican [link] [comments]
Today I Learned (TIL) You learn something new every day; what did you learn today? Submit interesting and specific facts about something that you just found out here.
- TIL Actor Gerard Butler paid for bee venom injections twice and ended up in hospital both times.by /u/Unleashtheducks on March 19, 2024 at 1:02 am
submitted by /u/Unleashtheducks [link] [comments]
- TIL about the loneliest whale in the world. Dubbed "The 52-hertz whale", it appears to be the only individual emitting a whale call at this frequency in the whole world. The whale itself has never been sighted.by /u/No_Idea_Guy on March 19, 2024 at 12:26 am
submitted by /u/No_Idea_Guy [link] [comments]
- TIL left-handed men are more likely to be homosexual than their right-handed counterpartsby /u/JeezThatsBright on March 19, 2024 at 12:17 am
submitted by /u/JeezThatsBright [link] [comments]
- TIL 1 out of 3 Americans live in just four states. California, Texas, Florida, and New York.by /u/PaulOshanter on March 18, 2024 at 11:27 pm
submitted by /u/PaulOshanter [link] [comments]
- TIL that in the year 2000, Norm MacDonald nearly won a million dollars for Paul Newman’s charity for children, but host Regis Philbin talked him out of answering the question so he only won $500,000by /u/BASSA_NOVA on March 18, 2024 at 10:34 pm
submitted by /u/BASSA_NOVA [link] [comments]
Reddit Science This community is a place to share and discuss new scientific research. Read about the latest advances in astronomy, biology, medicine, physics, social science, and more. Find and submit new publications and popular science coverage of current research.
- Researchers have discovered how the 'on-switch' for the body's inflammation machinery can get stuck, paving way for potential treatments for rare genetic inflammatory diseases.by /u/IMBatUQ on March 18, 2024 at 11:20 pm
submitted by /u/IMBatUQ [link] [comments]
- People with ‘Havana Syndrome’ Show No Brain Damage or Medical Illness - NIH Studyby /u/Rage_Like_Nic_Cage on March 18, 2024 at 8:42 pm
submitted by /u/Rage_Like_Nic_Cage [link] [comments]
- Whether a termite becomes a queen or sterile worker depends on where the expression of certain genes of the Queen Central Module takes place.by /u/NGNResearch on March 18, 2024 at 8:05 pm
submitted by /u/NGNResearch [link] [comments]
- A sprayable gel could make minimally invasive surgeries simpler and safer. Applied during endoscopic procedures, it provides prolonged tissue protection (3-7 days), facilitates wound healing, and minimizes the risk of delayed complications.by /u/Sariel007 on March 18, 2024 at 6:10 pm
submitted by /u/Sariel007 [link] [comments]
- For the first time, researchers showed that non-invasive brain stimulation (neuromodulation) can change a specific brain mechanism that is directly related to human behavior, this could help treat brain disorders (schizophrenia, depression, Alzheimer’s and Parkinson’s diseases)by /u/giuliomagnifico on March 18, 2024 at 6:00 pm
submitted by /u/giuliomagnifico [link] [comments]
Reddit Sports Sports News and Highlights from the NFL, NBA, NHL, MLB, MLS, and leagues around the world.
- Blake Snell agrees to 2-year, $62M deal with Giantsby /u/Oldtimer_2 on March 19, 2024 at 1:49 am
submitted by /u/Oldtimer_2 [link] [comments]
- Alabama gives DeBoer 8-year, $87 million deal; AD Greg Byrne, hoops coach Nate Oats get raisesby /u/Oldtimer_2 on March 19, 2024 at 12:39 am
submitted by /u/Oldtimer_2 [link] [comments]
- Dartmouth refuses to work with basketball players' union, potentially sending case to federal courtby /u/Oldtimer_2 on March 19, 2024 at 12:36 am
submitted by /u/Oldtimer_2 [link] [comments]
- 49ers signing veteran QB Joshua Dobbsby /u/Oldtimer_2 on March 18, 2024 at 11:52 pm
submitted by /u/Oldtimer_2 [link] [comments]
- Report: Saints expected to sign Young to 1-year, $13M dealby /u/Oldtimer_2 on March 18, 2024 at 9:33 pm
submitted by /u/Oldtimer_2 [link] [comments]