background preloader

Gitignore

Gitignore

Git Reference jsmits/github-cli Git FAQ What is Git? Git is a distributed version control system developed by Junio Hamano and Linus Torvalds. Git does not use a centralized server. Git runs on Linux, BSD, Solaris, Darwin, Windows, Android and other operating systems. Why the 'Git' name? Quoting Linus: "I'm an egotistical bastard, and I name all my projects after myself. ('git' is British slang for "pig headed, think they are always correct, argumentative"). Alternatively, in Linus' own words as the inventor of Git: "git" can mean anything, depending on your mood: Random three-letter combination that is pronounceable, and not actually used by any common UNIX command. How do I report a bug in Git? Bug reports can be sent to the Git mailing list: git@vger.kernel.org Please put "[BUG]" in the subject line. What's the difference between fetch and pull? The short definition is: Fetch: Download (new) objects and a head from another repository. Pull: Fetch (as defined above), and then merge what was downloaded with the current development. No.

Git User’s Manual (for version 1.5.3 or newer) This chapter covers internal details of the Git implementation which probably only Git developers need to understand. A birds-eye view of Git’s source code It is not always easy for new developers to find their way through Git’s source code. A good place to start is with the contents of the initial commit, with: $ git checkout e83c5163 The initial revision lays the foundation for almost everything Git has today, but is small enough to read in one sitting. Note that terminology has changed since that revision. Also, we do not call it "cache" any more, but rather "index"; however, the file is still called cache.h. If you grasp the ideas in that initial commit, you should check out a more recent version and skim cache.h, object.h and commit.h. In the early days, Git (in the tradition of UNIX) was a bunch of programs which were extremely simple, and which you used in scripts, piping the output of one into another. Now is a good point to take a break to let this information sink in. Voila.

git command-line usage cheatsheet/quickref master TOC | chapter TOC | license This document describes stuff that's not necessarily done every day. The bare minium stuff like git add/commit/push/checkout/branch etc is not covered. setting up I strongly recommend these settings to make life easier. bash aliases for git alias g='git --no-pager' alias gp='git -p' alias mg='git help' most useful stuff in $HOME/.gitconfig My .gitconfig is here . stuff you tend to forget add and commit # stage updates/deletes for files git already knows about git add -u [paths...] # ditto for ALL files, including new ones git add -A # stage updates/deletes for files git already knows about AND COMMIT git commit -a push don't forget to git push --tags when needed diff # diff between work area and stage git diff # diff between work area and repo (CVS model) # note that "git diff" + "git diff --cached" == "git diff HEAD" git diff HEAD # other coolness git diff "@{yesterday}" conflicts on pull/merge log pickaxe and blame misc oopsies! screwed up commit? useful commands

piecemeal staging committed 15 Jan 2009 This is a follow up to the comments from yesterday’s article about interactive adding . Readers were begging coverage of powerful git add -p , a shortcut to the patch mode of interactive adding. This behavior is very helpful since it allows you to version any “hunk” of text in the file that you’d like. Let’s go through an example of using it, making changes to our project’s trusty README file again. diff --git a/README.md b/README.md index 2556dae..45d8b6e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,14 @@ > There is only one way... > ~ Henry Van Dyke +# Project information + +Blah blah blah... + # Want to contribute? So as we can see, we’ve made changes in separate parts of the file. git add -p Run this and you’ll be greeted with a prompt just like git add -i , but it has quite a few options: Stage this hunk [y/n/a/d/s/e/?]? Most are pretty self-explanatory, but let"s go over the really cool ones. @@ -4,3 +8,7 @@ # Want to contribute?

git-reset git-reset The Git subcommand git-reset is very frequently used, and is one of very few commonly-used Git commands that can permanently destroy real work. Once work is in the repository, it is almost completely safe from any catastrophe. But git-reset also affects the working tree, and it is quite possible to utterly destroy a day's work by doing git-reset --hard at the wrong time. Unfortunately, the manual is unusually bad, with a huge pile of this stuff: working index HEAD target working index HEAD ---------------------------------------------------- A B C D --soft A B D --mixed A D D --hard D D D --merge (disallowed) working index HEAD target working index HEAD ---------------------------------------------------- A B C C --soft A B C --mixed A C C --hard C C C --merge (disallowed) Six more of these tables follow, giving the impression that git-reset is quite complicated. [ Other articles in category /prog ] permanent link

vcsh/README.md at master · RichiH/vcsh Version control with Git: resources — Fernando Pérez If you are not using a version control system for all your software development, paper writing, research code execution and tracking of the generated results, you should. There is simply no excuse today for not using version control as a mechanism for tracking what you are doing with your source materials and data (be they programming language files, LaTeX/LyX files, plain text, even data results!). Using version control frees you from the madness of having directories with files named mypaper_version2_20100202_revisions_jim_v3_new_new2.tex , for one thing. It gives you a mechanism to synchronize your work with colleagues without tracking who attached what version when, and a way to seamlessly replicate your work, including its history, across computers. Using a version control system is much, much easier than you think, and today’s best systems are powerful, well documented and free. Introductory materials Other resources Cheat sheets Git ready QGit : an excellent Git GUI Git Magic Tips

Related: