the phrygian cap


luisbg

@luisbg

luis@debethencourt.com



Ohloh profile for Luis de Bethencourt
Blogalia




<Abril 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 user.name "[name]"
      • Sets the name you want attached to your commit transactions
    • git config –global user.email "[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

93 Comentarios


Referencias (TrackBacks)

URL de trackback de esta historia http://luisbg.blogalia.com//trackbacks/76017

Comentarios

1
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.



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

That is a good trick Will!



3
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



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

What commit am I on?

git rev-parse HEAD



5
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'



6
De: Avneesh panwar Fecha: 2018-02-05 11:52

Thanks



7
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.



8
De: cbd isolate Fecha: 2018-02-07 14:01

Well we really like to visit this site, many useful information we can get here. cbd isolate



9
De: comic books Fecha: 2018-02-07 17:59

I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. comic books



10
De: dentists in elmhurst Fecha: 2018-02-07 20:26

this blog was really great, never seen a great blog like this before. i think im gonna share this to my friends.. dentists in elmhurst



11
De: Denver Party Bus Rentals Fecha: 2018-02-08 21:26

I must admit that your post is really interesting. I have spent a lot of my spare time reading your content. Thank you a lot! Denver Party Bus Rentals



12
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



13
De: Steve Dalton Fecha: 2018-02-09 10:54

College Essay Writing Service UK right now and allow us to offer you some of the best academic writing assistance available. Better still, we are a recognized and reliable service who will always deliver quality work.



14
De: California Vacation Rentals Fecha: 2018-02-10 00:06

This is a splendid website! I"m extremely content with the remarks!. California Vacation Rentals



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

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



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

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



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

Amazing article thanks or sharing..



18
De: BachJohann Fecha: 2018-02-13 14:10

Wow what a Great Information about World Day its exceptionally pleasant educational post. a debt of gratitude is in order for the post. putlocker



19
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..



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

This beneficial info and really motivated sites dukes hotel



21
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.



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

This is so amazing and useful magnificent details hotel rixos



23
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.



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

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



25
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



26
De: hotmail.com 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



27
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.



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

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



29
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!



30
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 college.it is useful For me Great Work.Thanks For sharing this Superb article.



31
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.



32
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.



33
De: Medical Homework Help Fecha: 2018-03-20 12:15

by visiting this site I found cool stuff here keep it up.



34
De: Matlab Assignment Help Fecha: 2018-03-20 12:15

only professional writers can make this kind of material, cheers



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

Nice and informative post thanks@



36
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..



37
De: full body massage centers indiranagar Fecha: 2018-03-22 08:46

This is one of the coolest page I ever visited. Make sure. Please visit my blog also. The blog name is full body massage bangalore.



38
De: body to body massage centers indiranagar Fecha: 2018-03-22 08:48

There are lots of unique body massage centers available in bangalore. Make sure to be wonderful visit for angelbodyspa.com



39
De: Female massage centers indiranagar Fecha: 2018-03-22 08:52

Are you looking for best massage centers for males and females. Then visit bangbodyspa for excellent massage service bangalore.



40
De: Body Square massage service bangalore Fecha: 2018-03-22 08:54

Bodysquare offers various massage services in mumbai, bangalore and chennai. Please visit body square massage services for more details.



41
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.



42
De: louvre museum tours Fecha: 2018-03-23 13:10

Happy to read this article and the data you had shared is much helpful for me.I'm looking forward this type of article and the way of your presentation also I like.Thanks for this article and keep sharing more informative articles.



43
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.



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

very nice post



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

very good article



46
De: Linear Programming Statistics Project Help Fecha: 2018-03-29 12:37

This site and the resources you provide is really nice keep it up.



47
De: Operations Management Homework and Project Fecha: 2018-03-29 12:38

Such a nice post, keep providing good resources.



48
De: Geographic Factors Homework Help Fecha: 2018-03-29 13:11

Hi buddy, your blog' s design is simple and clean and i like it. Your blog posts about Online Dissertation Help are superb. Please keep them coming. Greets!!



49
De: Probability Assignment Help Service Fecha: 2018-03-29 13:12

Good way of telling, good post to take facts regarding my presentation subject matter, which i am going to deliver in my college



50
De: Python Homework Help Fecha: 2018-03-29 13:32

This is really a great stuff for sharing. Keep it up .Thanks for sharing.



51
De: Aggregate Data In R Using Data Table Assignment Help Fecha: 2018-03-29 13:33

Well thanks for posting such an outstanding idea. I like this blog & I like the topic and thinking of making it right.



52
De: WORDAI Manual Multilevel Spinning Fecha: 2018-03-29 13:56

John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.



53
De: Econometrics Project Help Fecha: 2018-03-29 13:57

Great Information,it has lot for stuff which is informative.I will share the post with my friends.



54
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



55
De: Anónimo Fecha: 2018-04-02 00:11

Much thanks for keep this data. www.bahistadyum.com



56
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



57
De: Assignment help Fecha: 2018-04-04 13:44

Allassignmenthelp have well educated experts for writing assignment.Our assignment experts works hard to live up to the expectations and provide total peace of mind.We provide best assignment help.If you want any help related to assignment than contact our experts.https://www.allassignmenthelp.com/



58
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



59
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



60
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



61
De: Anónimo Fecha: 2018-04-08 23:15

That appears to be excellent however i am still not too sure that I like it. At any rate will look far more into it and decide personally! kebaponalti.gen.tr



62
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!



63
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.



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

Truly a masterpiece of an article, much appreciated.



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

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



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

I had to read this twice it was so good.



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

Thanks to the author for the article! Very pleased!



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

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



69
De: Cara Menyembuhkan Penyakit Hipertiroid Fecha: 2018-04-12 03:09

https://sites.google.com/site/tanamanobatuntukhipertiroid/ 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.



70
De: Google Chrome running out of memory Fecha: 2018-04-12 14:12

Thank you so much for this piece of information and it is much useful for me in the reference to my work.I'm looking forward this type of article and here most of the comments are shared.This will make my work easier.



71
De: Anónimo Fecha: 2018-04-13 12:19

Exceptionally valuable post. This is my first time i visit here. I discovered such a large number of fascinating stuff in your site particularly its exchange. Truly its awesome article. Keep it up. cheap postcards printing



72
De: Kellan Fecha: 2018-04-13 15:18

I will be very glad to visit your website often. As this website promotes unending knowledge. buy Nugenix direct



73
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



74
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.



75
De: Anónimo Fecha: 2018-04-14 12:04

New site is solid. A debt of gratitude is in order for the considerable exertion. appetite tonic stimulants



76
De: R Programming Homework Help Fecha: 2018-04-14 12:54

Things are very open and intensely clear explanation of issues. was truly information. Your website is very beneficial.



77
De: Sociology Homework Help Fecha: 2018-04-14 12:55

I’m really impressed with your article, such great & usefull knowledge you mentioned here



78
De: Statistics Assignment Help Fecha: 2018-04-14 12:56

This is really great work. Thank you for sharing such a good and useful information here in the blog for students.



79
De: Data Displays and Graphical Methods Assignment Help | StatsKey.com Fecha: 2018-04-14 13:40

Those who come to read your article will find lots of helpful and informative tips



80
De: Process Mapping Assignment Help | TheOperationsManagement.com Fecha: 2018-04-14 13:40

Really i appreciate the effort you made to share the knowledge. This is really a great stuff for sharing. Keep it up . Thanks for sharing.



81
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



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

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



83
De: Anónimo Fecha: 2018-04-14 23:04

Much obliged to you for another incredible article. Where else would anyone be able to get that sort of data in such an impeccable method for composing? I have a presentation one week from now, and I am on the search for such data. online bahis siteler



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

Hey, great site.



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

Get your pencils here.



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

The beats go on.



87
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



88
De: Anónimo Fecha: 2018-04-16 23:38

Much thanks for keep this data. www.stopdogbarkingbook.com



89
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. http://www.jagonyaobatherbal.com/2018/04/14/cara-menghilangkan-benjolan-di-alat-kelamin-pria-dengan-cepat/



90
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



91
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.



92
De: phen375 kaufen Fecha: 2018-04-24 14:31

Very useful advice and really well explained, thank mate- Keep it up!



93
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.



Nombre
Correo-e
URL
Dirección IP: 23.20.165.182 (b070ef5704)
Comentario
¿Cuánto es: mil + uno?

©2007-2015 luis de bethencourt guimera
powered by Blogalia