![]() $ git commit -m "Webgility ecc desktop connector files integrates with Quickbooks" Those deleted files weren't specifically part of my git add, but because they already were tracked in git, I need to remove them from this branch's commit: $ git checkout -b ecc Instead of confusing those file deletions with ecc, I'll make a different cleanup branch later to reflect those files' deletion.ģ) I didn't follow my workflow! I forgot about git while I was trying to get ecc working again.īelow: rather than do the all-inclusive git commit -am "updated ecc package" I normally would, I only wanted to add the files in the /ecc folder. " to include in what will be committed)ġ) In the output you can see the changes from the ECC package's upgrade, including the addition of new files.Ģ) Also notice there are two files (not in the /ecc folder) I deleted independent of this change. " to discard changes in working directory) Note: the output below is snipped git is quite verbose. Git commit -am "updated form in contact module"īelow: actual usage, including explanations. My workflow of git commands: git checkout -b contact-form I updated a package to my website and had to go back to my notes to see my workflow I thought it useful to add an example to this answer. Another newb situation is getting current code, which still manages to elude me. If you are like me, and not a Git-guru, my answer here describes handling the deletion of files from git's tracking without deleting them from the local filesystem, which seems poorly documented but often occurrence. This reference complements the first one nicely with more of a focus on those less acquainted with git. (that link points to github's "network" visualization tool) And here is another great reference with illustrations. Using -no-ff allows someone reviewing history to clearly see the branch you checked out to work on. Until I saw this, I was completely lost with git. Here is a site with a clear explanation and graphical illustration of using git merge -no-ff: This way you can regularly do something like git pull -ff-only without thinking, and then if it errors out you can go back and decide if you want to merge or rebase. Similarly, if you want to execute a git pull or use git merge in order to explicitly fast-forward, and you want to bail out if it can't fast-forward, then you can use the -ff-only flag. In order to do that, you can pass the -no-ff flag and git merge will always construct a merge instead of fast-forwarding. you're merging in a topic branch and you want to ensure it looks that way when reading history). However, occasionally you want to prevent this behavior from happening, typically because you want to maintain a specific branch topology (e.g. This commonly occurs when doing a git pull without any local changes. ![]() A fast-forward is when, instead of constructing a merge commit, git just moves your branch pointer to point at the incoming commit. The -no-ff flag prevents git merge from executing a "fast-forward" if it detects that your current HEAD is an ancestor of the commit you're trying to merge.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |