the phrygian cap



Ohloh profile for Luis de Bethencourt

<Junio 2018
Lu Ma Mi Ju Vi Sa Do
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  

Creative Commons License

planet gnome
planet ubuntu
alberto ruiz
andy wingo
jeff fortin
slomo's blog
jan schmidt
vincent's random waffle

"all religions, arts and sciences are branches of the same tree. all these aspirations are directed toward ennobling man's life, lifting it from the sphere of mere physical existence and leading the individual towards freedom." albert einstein

Git Cheat Sheet

A few weeks ago I created this Git Cheat Sheet as a reference for commands I use at least once a month. I've found it useful and I'm sharing it so others find it useful too. There are also markdown and org-mode versions available.

  • Configure
    • git config –global "[name]"
      • Sets the name you want attached to your commit transactions
    • git config –global "[email address]"
      • Sets the email you want attached to your commit transactions
    • git config –global color.ui auto
      • Enables helpful colorization of command line output
    • git config –global push.default current
      • Update a branch with the same name as current branch if no refspec is given
    • git config –global core.editor [editor]
      • Which editor to use when commit and tag that lets you edit messages
    • git config –global diff.tool [tool]
      • Specify which command to invoke as the specified tool for git difftool

  • Create repositories
    • git init [project-name]
      • Creates a new local repository with the specified name
    • git clone [url]
      • Downloads a project nd its entire version history

  • Make changes
    • git status
      • Lists all new or modified files to be committed
    • git status -s
      • Short view of status
    • git diff
      • Shows file differences not yet staged
    • git add [file]
      • Snapshots the file in preparation for versioning
    • git add .
      • Add all modified files to be commited
    • git add '*.txt'
      • Add only certain files
    • git add –patch filename.x (or -p for short)
      • Snapshot only chunks of a file
    • git rm [file]
      • Tell git not to track the file anymore
    • git diff –staged
      • Show what has been added to the index via git add but not yet committed
    • git diff HEAD
      • Shows what has changed since the last commit.
    • git diff HEAD^
      • Shows what has changed since the commit before the latest commit
    • git diff [branch]
      • Compare current branch to some other branch
    • git difftool -d
      • Same as diff, but opens changes via difftool that you have configured
    • git difftool -d master..
      • See only changes made in the current branch
    • git diff –no-commit-id –name-only –no-merges origin/master…
      • See only the file names that has changed in current branch
    • git diff –stat
      • See statistics on what files have changed and how
    • git reset [file]
      • Unstages the file, but preserves its contents
    • git commit
      • Record changes to git. Default editor will open for a commit message
    • git commit -m "[descriptive message]"
      • Records file snapshots permanently in version history
    • git commit –amend
      • Changing the history, of the HEAD commit

  • Group changes
    • git branch
      • Lists all local branches in the current directory
    • git branch [branch-name]
      • Create a new branch
    • git checkout [branch-name]
      • Switches to the specified branch and updates the working directory
    • git checkout -b <name> <remote>/<branch>
      • Switches to a remote branch
    • git checkout [filename]
      • Return file to it's previous version, if it hasn’t been staged yet
    • git merge [branch]
      • Combines the specified branch's history into the current branch
    • git merge –no–ff [branch]
      • Merge branch without fast forwarding
    • git branch -a
      • See the full list of local and remote branches
    • git branch -d [branch]
      • Deletes the specified branch
    • git branch -D [branch]
      • Hard branch delete, will not complain
    • git branch -m <oldname> <newname>
      • Rename a branch

  • Refactor filenames
    • git rm [file]
      • Deletes the file from the working directory and stages the deletion
    • git rm –cached [file]
      • Removes the file from version control but preserves the file locally
    • git mv [file-original] [file-renamed]
      • Changes the file name and prepares it for commit

  • Suppress tracking
    • .gitignore
      • *.log
      • build/
      • temp-*
      • A text file named .gitignore suppresses accidental versioning of files and paths matching the specified patterns
    • git ls-files –other –ignored –exclude-standard
      • Lists all ignored files in this project

  • Save fragments
    • git stash
      • Temporarily stores all modified tracked files
    • git stash pop
      • Restores the most recently stashed files
    • git stash list
      • Lists all stashed changesets
    • git stash drop
      • Discards the most recently stashed changeset

  • Review history
    • git log
      • Lists version history for the current branch
    • git log –follow [file]
      • Lists version history for a file, including renames
    • git log –pretty=format:"%h %s" –graph
      • Pretty commit view, you can customize it as much as you want
    • git log –author='Name' –after={1.week.ago} –pretty=oneline –abbrev-commit
      • See what the author has worked on in the last week
    • git log –no-merges master..
      • See only changes in this branch
    • git diff [file-branch]…[second-branch]
      • Shows content differences between two branches
    • git show [commit]
      • Outputs metadata and content changes of the specified commit

  • Redo commits
    • git reset
      • Unstage pending changes, the changes will still remain on file system
    • git reset [commit/tag]
      • Undoes all commits after [commit], preserving changes locally
    • git reset –hard [commit]
      • Discards all history and changes back to the specified commit

  • Synchronize changes
    • git fetch [bookmark]
      • Downloads all history from the repository bookmark
    • git fetch -p
      • Update history of remote branches, you can fetch and purge
    • git merge [bookmark]/[branch]
      • Combines bookmark's branch into current local branch
    • git push
      • Push current branch to remote branch
    • git push [remote] [branch]
      • Manually specify remote and branch to use every time
    • git push -u origin master
      • If a remote branch is not set up as an upstream, you can make it so
    • git pull
      • Downloads bookmark history and incorporates changes
    • git pull [remote] [branch]
      • Specify to pull a specific branch
    • git remote
      • See list of remote repos available
    • git remote -v
      • Detailed view of remote repos available
    • git remote add [remote] [url]
      • Add a new remote

77 Comentarios

Referencias (TrackBacks)

URL de trackback de esta historia


De: William Manley Fecha: 2015-12-04 18:15

If you like `git commit --amend` try `git commit --fixup=[sha]` followed by `git rebase -i --autosquash`. It allows you to change history of commits other than HEAD, but in a way where you're less likely to get confused if you manually fiddle with `git rebase` command list.

De: luisbg Fecha: 2015-12-04 18:44

That is a good trick Will!

De: Embedded Systems Fecha: 2015-12-05 20:19

Following the idea of luisbg a better way to change previous commits is to use the `git rebase -i Head~3` that will open for you the editor with all the options to rewrite, reorder, merge or delete your 3 previous commits. Just change the 3 by the number of commits you need to edit

De: Userman Fecha: 2015-12-06 02:22

What commit am I on?

git rev-parse HEAD

De: Matthew Russell Fecha: 2015-12-06 19:03

Good sheet. I use Oh-My-Zsh, so I always check my aliases for the shortcut. e.g. say I forget how to set my upstream, I do `alias | grep upstream` and get:

ggsup='git branch --set-upstream-to=origin/$(current_branch)'
glum='git pull upstream master'
gmum='git merge upstream/master'
gpu='git push upstream'

De: palm tree court and spa Fecha: 2018-02-06 13:48

This is certainly good and useful information. I really think that you’re good blogger, dedicated to creating good content. I hope to come back to continue reading and reviewing this post.

De: jnyandrss Fecha: 2018-02-09 10:08

I am highly excited on your post I love the data you offered gold and silver ira scams and frauds on the internet

De: mrycogwls Fecha: 2018-02-10 03:44

Extraordinary and eye-catching site your are perfect developer to provide this site testosterone boosters

De: Assignment For Myob Fecha: 2018-02-13 10:00

I appreciate your efforts in preparing this post. I really like your blog articles.

De: Online Psychology Homework Help Fecha: 2018-02-13 10:01

Amazing article thanks or sharing..

De: survival food Fecha: 2018-02-13 15:27

There's a lot of useful information here, I am glad to visit here this are the information I am really need..

De: tffnysrys Fecha: 2018-02-15 08:24

This beneficial info and really motivated sites dukes hotel

De: athletic greens supplement Fecha: 2018-02-15 13:17

Great stuff, thanks for sharing your high value articles on this web! I always look forward to your amazing thoughts.

De: krsblchrd Fecha: 2018-02-17 23:21

This is so amazing and useful magnificent details hotel rixos

De: James Moliver Fecha: 2018-02-20 08:01

I have been teaching in a UK school since last 10 years and I love this profession because my parents was also a teacher. I teach and I work with Help With Essay Writers UK to provide a best possible solution to the students.

De: laurnsyrs Fecha: 2018-02-22 23:21

Wonderful post. It's actually very enjoyable and effective article Performix SST Reviews

De: Dissertation Help Fecha: 2018-02-28 07:56

We always have to maintain allot of doing something better in a unique with a better life style in good note

De: Fecha: 2018-03-01 15:32

We always have to maintain allot of doing something better in a unique with a better life style in good note

De: Male Enhancement Pills Fecha: 2018-03-02 15:49

Keep up the fantastic piece of work, I read few blog posts on this web site and I believe that your site is really interesting and has lots of great information.

De: shrndhln Fecha: 2018-03-06 05:25

This is an important method and the skills are outstanding post ketosis drink

De: best whey protein powder Fecha: 2018-03-09 07:15

I’m genuinely enjoying reading your article. This is truly very informational post. Thanks for the share and looking forward for more posts!

De: how to get a six pack Fecha: 2018-03-16 11:56

thanks For sharing this Superb article.I use this Article to show my assignment in is useful For me Great Work.Thanks For sharing this Superb article.

De: Jake George Fecha: 2018-03-17 11:13

I am an expert blogger and I have to read and write approximately academic troubles. This post is in reality well written on the critical concern and I suppose that maximum of the student has no longer accurate writing abilities that is why they try to get assist from Best UK Essay Writing Service to successfully reap their academic dreams.

De: HGH diet review Fecha: 2018-03-17 14:33

These are fabulous information, much like all the incredible tips you offered are very useful. I really admired your greatness.

De: ipad hire for events Fecha: 2018-03-20 13:02

Nice and informative post thanks@

De: assignment writing services Fecha: 2018-03-22 08:11

Awesome post. thanks for the shared this informative and interesting post with us.. I really enjoyed your post..

De: bathmate before and after Fecha: 2018-03-23 09:03

Your site fantastic, superior quality succeed... Most probably various should realize others despite that they don't take time to advise you.

De: Male Enhancement Pills Fecha: 2018-03-26 17:08

I cannot thank you enough for all the articles you have written. I only hope that you have helped others as much as you have helped me through your inspiring posts.

De: sara Fecha: 2018-03-27 16:19

very nice post

De: julia Fecha: 2018-03-27 16:19

very good article

De: Assignment Writing Service Fecha: 2018-03-30 09:55

This is amazing information and get the best part of my life i have been so many article reading but this one my different and helpful keep more posting thanks

De: uali20 Fecha: 2018-04-03 11:58

Your content is nothing short of brilliant in many ways. I think this is engaging and eye-opening material. Thank you so much for caring about your content and your readers. Detectives privados Madrid tarifas

De: Escape room in south florida Fecha: 2018-04-06 09:37

Thank you, I've been seeking for info about this subject matter for a long time and yours is the best I have discovered so far.Escape room in south florida

De: mycfavisit Fecha: 2018-04-06 13:30

It is a good and amazing article. Your information is very useful for me and for others. mycfavisit

De: krnknghts01 Fecha: 2018-04-07 08:32

Incredible wonderful results it is so brilliant info and details here legit ways to make money online

De: assignment help Services Fecha: 2018-04-09 13:03

That seems, by all accounts, to be magnificent anyway I am as yet not very beyond any doubt that I like it. At any rate, will look much more into it and choose by and by!

De: Best Fat Burners For Men Fecha: 2018-04-09 23:47

Another excellent article, very impressive work, I will bookmark this page and return soon.

De: Best HGH Supplements Fecha: 2018-04-09 23:50

Truly a masterpiece of an article, much appreciated.

De: Leanbean Review Fecha: 2018-04-09 23:57

This article is second to none. Going to have to look in to this further.

De: Best Testosterone Boosters Fecha: 2018-04-10 00:42

I had to read this twice it was so good.

De: color switch Fecha: 2018-04-10 10:16

Thanks to the author for the article! Very pleased!

De: color switch Fecha: 2018-04-10 10:17

Thanks to the author for the article! Very pleased!
color switch

De: Cara Menyembuhkan Penyakit Hipertiroid Fecha: 2018-04-12 03:09 So whether your child is learning English for the very first time or is almost fluent, our unique approach will give them all the individual attention and opportunities they need to express themselves in a relaxed and supportive atmosphere.

De: Funny Shirts Fecha: 2018-04-14 07:38

This is a wonderful article, given so much info in it. These type of articles keeps the users interest in the website. Keep on sharing more...good luck.Funny Shirts

De: diet pills for women Fecha: 2018-04-14 09:48

I know that you explain it very well. And I hope that other readers will also experience how grateful I am after reading your article.

De: Top 10 Best Male Enhancement Pills That Work Fast Fecha: 2018-04-14 19:09

Thanks for sharing this useful information! I am very happy to read this article... Buy Male Enhancement

De: daily health issues articles Fecha: 2018-04-14 19:10

Your post is always very good ... Health "write for us"

De: Ph.375 Fecha: 2018-04-14 23:53

Hey, great site.

De: Karen Anderson Fecha: 2018-04-14 23:56

Get your pencils here.

De: Adam Lancaster Fecha: 2018-04-15 00:01

The beats go on.

De: leahstnleys01 Fecha: 2018-04-16 09:39

I think this is an highly precious post and it is very powerful for me seo services maine

De: cara menghilangkan benjolan di alat kelamin pria Fecha: 2018-04-17 03:00

People throughout the world appreciate Kohinoor XL as it lengthens the muscle of male organ, provides extended pleasure at night, and also act as a natural aphrodisiac. Due to the herbal ingredients, and no side effect result, it is recommended by the healthcare experts. It is also widely used by the men for strength and vitality enhancement.

De: Mengenal 5 Bahaya Varises Pada Wanita Hamil Fecha: 2018-04-18 08:52

So whether your child is learning English for the very first time or is almost fluent, our unique approach will give them all the individual attention and opportunities they need to express themselves in a relaxed and supportive atmosphere

De: cvs employee login Fecha: 2018-04-20 06:37

Thanks for a wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant.

De: online assignment help Fecha: 2018-04-24 14:51

Git is the open source distributed version control system that facilitates GitHub activities on your laptop or desktop. This cheat sheet summarizes commonly used Git command line instructions for quick reference.

De: forskoline Fecha: 2018-05-03 14:49

Excellent stuff, really worthwhile spendinf time in here

De: Online Assignment Help UK Fecha: 2018-05-04 07:24

Did you need UK best essay writing done urgently? Then you need to contact Best Essays Writing right away. Then, not only will you get work that is perfectly written, the work will also be complete, it will meet all your work requirements, and best of all, will be ready for delivery on time.

De: Dissertation writing Fecha: 2018-05-04 14:01

Such an amazing blog. I was researching this topic and it really helped me a lot in my work. Thanks for posting. Happy blogging.

De: Solusi Alternatif Untuk Mengatasi Kutil Kelamin Fecha: 2018-05-05 02:50

period has the greatest influence on the formation of a man as a creative person.

De: Solusi Alternatif Untuk Mengatasi Kutil Kelamin Fecha: 2018-05-05 02:50

period has the greatest influence on the formation of a man as a creative person.

De: laurnsyrs Fecha: 2018-05-07 00:34

I found so many superb topic here is truly special for me performix benefits

De: Essay Writing Fecha: 2018-05-07 13:28

Most university going students tend to worry over ‘Where will I find the perfect assignment writer who can write assignments according to the mentioned guidelines?’ Thus, when stricken with such thoughts what becomes important is to delegate your workload to Academic Writing Experts. As their writers are experienced and qualified enough to curate brilliance translated onto paper.

De: Anvarol reviews Fecha: 2018-05-08 10:32

Best cutting supplement on the market also referred to as legal Anavar

De: Online Dissertation Help Fecha: 2018-05-09 07:23

When you need swift dissertation help at the eleventh hour, then look no further than us at British Dissertations Help. Our native English writers have a developed a reputation for being exceedingly fast. On top of this, they are also graduates from leading UK universities and will equip you with top class writing work. You can trust them to finish your work in a matter of hours, with plenty of time leftover on the side for proofreading. We are all you need at this last moment of desperation, so grab your phone and call our agents to learn more.

De: Top Essay Writing Service Fecha: 2018-05-10 07:51

Such an amazing and helpful post. It was really helpful for the new tips and making the work easier. Thanks a lot for sharing these amazing tactics.

De: jenny Fecha: 2018-05-12 04:43

This facts you launch is incredible! Thanks for you done I truly happy to seen this site gold and silver ira scams and frauds on the internet

De: barbarapt Fecha: 2018-05-15 00:02

The design and info that you provide is so the most powerful it works reviews

De: Male Enhancement Supplements Fecha: 2018-05-15 08:02

Nice words of wisdom, thank you for all the insights you have shared to us.

De: anbrwnes01 Fecha: 2018-05-18 02:07

It is extremely and helpful site and also the data here is so brilliant how can you make money from blogging

De: Best dianabol alternative Fecha: 2018-05-21 12:07

Veru useful and handy stuff. Thanks mate, keep it up!

De: Walatra Berry Jus | Anti-Kanker & Anti-Tumor Fecha: 2018-05-22 08:21

You are merely a click away to decide on any of our service. Don’t squander your time and energy in wondering Significantly. All of the benefits specified earlier mentioned is sufficient to conveyance you about our greatest providers.

De: Walatra Berry Jus | Anti-Kanker & Anti-Tumor Fecha: 2018-05-22 08:21

You are merely a click away to decide on any of our service. Don’t squander your time and energy in wondering Significantly. All of the benefits specified earlier mentioned is sufficient to conveyance you about our greatest providers.

De: Writ My Essay For Me In UK Fecha: 2018-05-23 07:14

One of the most recurrent thoughts which occur in the mind of a student is ‘Who will write my essay?’ This thought usually cross their mind when they are encumbered by energy and time constraints. Hence, rather than overthinking matters what is important is to make use of British Custom Essay

De: Professional assignment helper Fecha: 2018-05-23 11:59 is one of the best assignment help providing company who's Professional assignment helper are more efficient and capable in doing assignment frequently. Complete your assignment in short span of time and get higher grades in college for assignment help at reasonable price.

De: Dating Fecha: 2018-06-04 17:16

This is kind of how I write for my blog. I’ve been thinking of ways of putting up more content during the week, though, and I think the idea of delayed posts could work great. Great post, thanks for the tips!

De: phen375 reviews Fecha: 2018-06-12 11:31

All these commands are very useful tools for everyday use. Great idea and very well presented.

De: pakistan elections Fecha: 2018-06-20 08:22

All these commands are very useful tools for everyday use. Great idea and very well presented.

Dirección IP: (b768b8143f)
¿Cuánto es: diez mil + uno?

©2007-2015 luis de bethencourt guimera
powered by Blogalia