Monday, March 26, 2018

git

  • Installing on Linux
If you want to install the basic Git tools on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution. If you’re on Fedora for example (or any closely-related RPM-based distro such as RHEL or CentOS), you can use dnf:
$ sudo dnf install git-all
If you’re on a Debian-based distribution like Ubuntu, try apt-get:
$ sudo apt-get install git-all
https://git-scm.com/book/en/v2/Getting-Started-Installing-Git


  • I’m often asked how to merge only specific commits from another branch into the current one. The reason you’d want to do this is to merge specific changes you need now, leaving other code changes you’re not interested in right now behind

62ecb3 is now applied to the master branch and commited (as a new commit) in master. cherry-pick behaves just like merge
https://www.devroom.io/2010/06/10/cherry-picking-specific-commits-from-another-branch/


  • Why would I use this?

That is a good question. Why would you cherry-pick instead of just merging one branch into the other? The short answer is that you cherry-pick when a full branch merge is not possible due to incompatible versions or simply because you do not want everything in the other branch
https://swsblog.stanford.edu/blog/cherry-picking-small-git-lesson

No comments:

Post a Comment