GIT Command notes - G IT gitarchive git archive-format...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
GIT git-archive git archive --format tar.gz --prefix proj-0.9.1/ --output proj-0.9.1.tar.gz master git-branch Remove a branch which has been fully merged into master: git branch -d branch1 Remove a branch, no matter what: git branch -D branch1 Rename a branch: git branch -m branch1 branch2 git-checkout Pulling changes to a specific file from another local branch git checkout branch1 src/mara.cpp git add src/mara.cpp git commit -m "Pulled bug fix to mara.cpp from other branch." Checking out a remote branch. Usually we want it to be a tracking branch. git checkout -t origin/branch1 git-cherry-pick Say another branch made many commits, and rather than merging them all into the present branch, you only want the  most recent commit. By doing git cherry-pick other_branch a new commit will be created on the present branch with the same changes, and annotation as the commit made to  'other_branch'.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
git-commit Let's say you realize that a commit was flawed or incomplete. To effectively overwrite it, first add any additional files to 
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern