Say you are working on a project or learning something or doing challenge like #100daysofcode and you are only person who is committing files to th...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
I am mystified. What was wrong with
git push
?
I did this because I have been doing 100 days of code for quite a long time and repeatedly pushing file with same command was quite irritating for me. So I thought to abstract the whole process into a single bash command. Hence I did all this. I found it the process useful so I thought to share with the community.
This one does add all -> commit with message -> push
git commit -a -m "message here" & git push
And if you do it once, its always in your history
That's a better approach.
Actually I dont do that myself. I always leave off the -m and let it pop up vim for me to enter a commit message. Usually I want to review what files are getting committed, and often my commit message is a short story.
Yeah, I see your point. The way I see it, even setting up aliases makes is much easier than having to condense everything in a single line.
Did you really hide my comment? I even told you about a bug in your script that you've fixed now.
Yes I did!! It was a typo not a bug
I find this very unkind. My comment was not offending by any means.
It was aggressive and it did offend me. I think it would be nice of you of you appreciate things instead saying what you prefer.
It's not about things I prefer. I started a conversation whether the recommendations you give in your blog are best practice.
Alright. I might have misread. I will take your suggestions. Thank you for that :)
And I believe it would be great if you politely read what I have written on the blog.
There are probably not many developers out there who favour the CLI over a Git UI, but at the same time are too lazy to type 3 short commands + commit message instead of 1 short command + commit message.
However my workflow doesn't even include
git add .
every time I want to commit something. It could add temporary/build files that I don't want being tracked by git, sogit -a -m '...'
is a safer approach, by which we're down to 2 short commands + commit message (w/o your script).Oh, and please don't start start a "TLDR" with "Basically this is a self explanatory code", because TLDR makes the reader expect a summary. And telling your reader to read the complete code is the opposite of a summary. Btw: it has to be
if [ -n $(...) ]
instead ofif [ n $(...) ]
.Maybe add your password or ssh key in the env too 😝
shouldn't need to if your ssh-agent is setup properly ;)
Yes! We can. But i avoided it on purpose and thank you for suggesting
Everything is #devops nowadays haha.
I can see how this is good to have for your particular use case, but it's exactly that, just for one case. Wouldn't want to accidentaly run this on a local branch other that master though.
Yes, it has.But when you are working on something like 100daysofcode or you are only person working on a repository and you know in and out of it. Then, this could be useful instead of every time typing same git commands to push files.
I did this because I have been doing 100 days of code for quite a long time and repeatedly pushing file with command was quite irritating for me. So I thought to abstract the whole process into a single bash command. Hence I did all this. I found it the process useful so I thought to share with the community.
Top!
Thanks!
Great, a dynamic branch, would be a nice to have.
Yes, Abdellatif.