DEV Community

Cover image for Next step Git for those that already know add and commit

Next step Git for those that already know add and commit

Jakob Christensen on March 30, 2018

When I first started using Git a while back it seemed pretty straight forward although I had to get used to the disconnected nature of Git which ...
Collapse
 
ghost profile image
Ghost

This is actually the best! Thank you so much!

One question, though: with the aliases, is their anyway to make it so that it accepts terms? i.e. I want to make it so I can do $ git c "commit message", and it'll action that as $ git commit -m "commit message". Is that possible?

Collapse
 
t4rzsan profile image
Jakob Christensen

You are welcome :)

Aliases are really just a search and replace. So you can do

git config --global alias.cm "commit -m" 

and then


git cm "My commit message"

will be replaced with

git commit -m "My commit message"
Collapse
 
ghost profile image
Ghost

Ah, gotcha! Thank you so much again!

Collapse
 
maxdevjs profile image
maxdevjs

Nice list, thank you. I found some new things to try out :)

At some point, this became one of my favorite configurations:

[credential]
  helper = cache --timeout=...
Collapse
 
polentino911 profile image
Diego Casella

For those who use a lot the CLI, I would highly recommend also to install tig - a text mode interface for GIT.
There's also a good introductory blog post by the guys at Atlassian, which is also how I stumbled upon this handy project.

Collapse
 
t4rzsan profile image
Jakob Christensen

Thanks for sharing, Diego. I did not know about Tig.

Collapse
 
eljayadobe profile image
Eljay-Adobe

TFS originally had only TFVC. Now it has TFVC or Git for version control.

TFS is a big umbrella -- a suite of tools for ALM, including version control.

TFS/TFVC is just the original version control part. (1)

TFS/Git is just the recently added version control part.

The one thing that, alas, TFS does not do is bridge TFS/TFVC and TFS/Git. They are separate version control subsystems, and do not interoperate.

Some people have created various TFS and Git bridging utilities, but they have their own quirks and problems. From my coworkers who used them, the pain was not worth the gain. (2)

(1) TFVC was created by Brian Harry, the same person who created SourceSafe, and who inadvertently created what eventually became .NET because he hated COM. The origin tales of .NET are crazy wonderful, and show how innovation can come from anywhere.

(2) My coworkers were no slouches at TFS (the ALM), or TFVC, or at Git, or at another version control system called Source Depot only used internally. Because at that time, my coworkers were Microsoft coworkers, and we worked on a product called Visual Studio.

Collapse
 
rupeshiya profile image
Rupesh Krishna Jha

git rebase -i HEAD~n can also be added . But it was really good.

Collapse
 
tmcsquared profile image
TMcSquared

This is an awesome compilation Jakob. Thanks for taking the time to write this stuff down.

I could use those aliases pretty well, :) I didn't even know it was possible!

Collapse
 
t4rzsan profile image
Jakob Christensen

I'm glad it was of use to you. Thanks :)

Collapse
 
letsbsocial1 profile image
Maria Campbell

Fantastic post Jakob. Thanks for sharing!

Collapse
 
t4rzsan profile image
Jakob Christensen

Thanks Maria. I appreciate it.

Collapse
 
bugsenpai profile image
bugsenpai

thank you it work as well