git-log

Clean master branch but also detailed record of intermediary commits

安稳与你 提交于 2019-12-12 05:14:21
问题 Goal : keep a clean history of master, whilst also keeping the intermediary commits. For instance , let's start with a master branch: M1 --- M2 --- M3 ^ master I work on a feature/bug/whatever on a new branch: M1 --- M2 --- M3 ^ \ | \- F1 --- F2 -- F3 | ^ master feature And when I merge into master, I want M3 to be the parent, but also keep the "iterations" you took to reach from M3 to the new commit. This can be done with merge --no-ff : M1 --- M2 --- M3 ----------------------- M4 \ / ^ \-

How to generate a log entry on master when creating and deleting a dev branch?

自古美人都是妖i 提交于 2019-12-12 03:06:27
问题 I'm trying to close an Audit and C&A gap in our processes. Our master is stable, and the typical workflow for feature development is (1) create dev branch, (2) develop on dev branch, (3) merge dev branch into master, (4) delete dev branch. The logging we are trying to achieve on Master for the lifecycle is for the events: Create dev branch Merge dev branch into Master Delete dev branch We have Event 2 already. When we merge a dev branch into master, we use --squash to ensure the logs on dev

How to commit date in “git log --all --graph --oneline --simplify-by-decoration”

旧街凉风 提交于 2019-12-11 16:09:00
问题 I use git log --all --graph --oneline --simplify-by-decoration to show large git commit history, but there is no commit date, what can add date? 回答1: Following seems to be the closest to what you need based on your color needs, it adds commit date per your format, check it out to see if it helps: git log --all --graph --oneline --simplify-by-decoration --date=short --pretty=format:"%C(yellow)%h%Creset%C(red)%C(bold)%d%Creset%C(white)(%cd)%Creset %s" For further reading and to choose from a

how to get full commit log from a shallow clone?

只愿长相守 提交于 2019-12-11 05:06:41
问题 Is it possible to get the commit log history from a local copy which is a shallow clone (--depth = 1) I am using shallow clone in my jenkins build job to get the code and build but the changelog is not complete because I am using shallow clone. Is there a way around that? 回答1: No you cannot. But if it helps, you can get a list of tags (if your jenkins job wants to check a tag) via git ls-remote. Mort 来源: https://stackoverflow.com/questions/30158978/how-to-get-full-commit-log-from-a-shallow

Displaying git diff and git log output on a separate terminal screen

…衆ロ難τιáo~ 提交于 2019-12-11 03:09:14
问题 After setting up new development environment I encountered a strange git behavior that I don't recall seeing in the past. I am used to git diff and git log creating a new screen in the terminal and displaying their output inside (what less does by default, and I'm using it as my pager). I can then quit and go back to my previous terminal state, with the command output gone. Now, however, output is printed right into the same screen as if it was cat (but with a pager). Any ideas how to fix

Collecting a list of all branches in a repository in a special format [Git]

眉间皱痕 提交于 2019-12-10 10:44:41
问题 Is there a way to collect a list of the branch in a repository and there last commit date? In other words, I would like to print something like this to the stdout: branch_name_1 date1 branch_name_2 date2 branch_name_3 date3 Is it possible? EDIT : I tried to use the following steps: git log --pretty=format:"%ad:%an:%d:%B" --date=short --branches git branch -a git ls-remote –heads each one of them gives me the branches of the repository which I currently in. But now I would like to check if it

What's the best practice of going GIT when upstream is 100% CVS?

无人久伴 提交于 2019-12-09 21:43:34
问题 I'm curious what's the best practice of keeping your occasional contributions to an OSS project in git (e.g., on github/bitbucket/gitlab), whilst the upstream is exclusively CVS. My take is that it's very convenient to simply commit CVS/{Entries,Repository,Root} directly into git , and then at any time and from any box, you can simply checkout your git repo (w/ git ), and then update from the real upstream with cvs up , which is exactly what I do with my OpenBSD ports-readmes fork, as well as

How do I show just the names and commit titles since a tag in Git?

风流意气都作罢 提交于 2019-12-09 04:03:46
问题 I'm trying to use tags for release management in Git—I create a tag for each release. I'd like to be able to create release notes by listing the comment titles for every commit since a tag, or between 2 tags. I can't seem to find any way to do this. 回答1: If your tags are named LastRelease and NextRelease then do git log --pretty=format:%s LastRelease..NextRelease . 回答2: To show commits since TAG to current head: git log TAG..HEAD Between two commits: git log TAG..TAG For formatting the log

`git log --follow --graph` skips commits

一曲冷凌霜 提交于 2019-12-09 01:14:11
问题 Setup git version 2.11.0.windows.1 Here is a bash snippet to reproduce my test repository: git init # Create a file echo Hello > a.txt git add a.txt git commit -m 'First commit' # Change it on one branch git checkout -b feature echo Hi > a.txt git commit -am 'Change' # Rename it on the other git checkout master git mv a.txt b.txt git commit -m 'Move' # Merge both changes git merge --no-edit feature At the end, git log --graph --pretty=oneline --abbrev-commit prints: * 06b5bb7 Merge branch

git log decoration origin/HEAD

僤鯓⒐⒋嵵緔 提交于 2019-12-08 07:52:55
问题 I have two project repositories. When I run git log --oneline --decorate --graph in each, one shows (HEAD, origin/dev, origin/HEAD, dev) and the other shows (HEAD, origin/dev, dev) . In both cases, dev is the default branch. Why does origin/HEAD show in one and not the other? What does one do to make origin/HEAD appear or not appear? 回答1: As mention in "How does origin/HEAD get set?", it is set automatically on git clone . That means: either your second repo wasn't cloned (but initialized