commit

What is the effect of git commit without the -a option?

爷,独闯天下 提交于 2019-12-18 12:12:21
问题 What is the difference between these two commands? git commit -m "added a new page" and git commit -a -m "added a new page" I know that the -a option will stage files that have been modified and deleted, but then what does running it without the -a mean? 回答1: You have to explicitly stage changes for commitment by using git add or git rm . If you use the -a flag when doing a commit, git will automatically stage any modified and removed files without you having to explicitly stage them using

Git: How to edit/reword a merge commit's message?

℡╲_俬逩灬. 提交于 2019-12-18 09:56:11
问题 How do I edit or reword a merge commit's message? git commit --amend works if it's the last commit made ( HEAD ), but what if it comes before HEAD ? git rebase -i HEAD~5 doesn't list the merge commits. 回答1: If you add the --preserve-merges option (or its synonym, -p ) to the git rebase -i command then git will try to preserve the merges when rebasing, rather than linearizing the history, and you should be able to amend the merge commits as well: git rebase -i -p HEAD~5 回答2: Note that,

Is there a git style amend option in TFVC?

自作多情 提交于 2019-12-18 07:34:12
问题 In git there is a very handy feature that lets you fix your last commit, e.g. when you have forgotten something that does not justify a full commit. It is very easy to do this in git: git commit --amend That way you don't have to specify a commit message or anything else, the commit is simply "appended" to your last full commit - or at least that is how I understand it. Is there anything similar available in TFVC? 回答1: No, not really. You can update the Check-in comment, or associate a work

Committing a project commits to the solution, why?

痞子三分冷 提交于 2019-12-18 07:22:48
问题 Whenever I commit a project in a solution, if I go to a Git Bash and do some git log , none of the commits are present in the project folder, however they're all present on the solution folder. How is one supposed to do for having commits per project rather than for the solution ? Should I just do everything by myself on the Git Bash rather than using the IDE ? 回答1: Should I just do everything by myself on the Git Bash rather than using the IDE ? YES you should. And there are (IMO) good

Git does not recognize new folder adds and its sub directories

爷,独闯天下 提交于 2019-12-18 07:05:34
问题 I have: dirA/dir1 dirA/dir2 dirA has been added and I see it on the browser - when I click " dirA ", I see dir1 and dir2 , grayed out like I have explained below. dir1 and dir2 , both have more than one sub-directories and files. git add dir1 git commit -m "..." I get a message " On branch master, nothing to commit, working directory clean " I am not sure why it wont go through and I see those as "grayed out" on the GitHub repo via browser. Can someone help? I saw some similar threads on

How to change author email at commit time with hooks

穿精又带淫゛_ 提交于 2019-12-18 05:07:06
问题 Question says it all. I want to give my users some privacy by obfuscating their real email addresses in commits by aliases of my own. Is there a hook that can help me do this? 回答1: You could just get them to change the user.email property in their local repository. git config user.email email@server.com 回答2: No matter what else happens, if you change something—even a single character in the user name and/or email—in some commit, you get a new, different commit. (This is because the commit ID

Git hook, modify commit files

荒凉一梦 提交于 2019-12-18 04:14:15
问题 I'm trying to write git pre-commit hook script, it should write date of commit at the begining of modified files. My problem is that i can't add modified files to previous commit. When i trying invoke git commit again it runs recursive. How i can write script, which append time of modification at the end of modified files? My code: #!/bin/bash files_modified=`git diff-index --name-only HEAD` for f in $files_modified; do if [[ $f == *.groovy ]]; then $line = $(head -1 f) if [[ $line == "/%%*"

how to write a svn hook script

最后都变了- 提交于 2019-12-17 22:00:04
问题 I'm trying to write a post commit hook script for svn to export repository to team foundation server. (So when you commit a code, that latest version of the code gets copied to team foundation repo ) Only language I use is C++ and C and I have never written a script. Can anybody give me step by step instruction for this? which language to use, what to read etc... along with some example code possibly ?? Is it possible to write a hook script with c++? or should I learn how to use python or

Git remove root commit

元气小坏坏 提交于 2019-12-17 20:44:12
问题 I can't do a lot of things with git and I want to remove a commit from my repo, because I uploaded wrong stuff. I used git revert <the_commit> but since the commit is root and I can't remove it. fatal: Cannot revert a root commit What to do in that case ? Please don't give me links to other topics here, I read them and I don't understand what to do, I need some basic example about removing some commit. 回答1: For removing a root commit, you simply have to remove all branches (and tags) from

Git pull change log

假装没事ソ 提交于 2019-12-17 18:36:07
问题 After pulling from a git server, I'm trying to get a list of all changed files. I don't need any specific parts of code, just a list of files (with some kind of indication as to wether it's been added, removed or changed). I first looked at using git log, but that appearantly only returns info from the last commit: git log --name-status --max-count=1 --pretty=format:"" Since this appearantly only gets the changes from the last commit in a pull, I'm trying to find a way to get all the changes