Tag: c

56 votes
27 answers
502 views
How to count lines in a document?

I have lines like these, and I want to know how many lines I actually have... 09:16:39 AM all 2.00 0.0

avatar
Luis
0 1 0 9
asked 07 September, 2021
61 votes
5 answers
2.9K views
What is ":-!!" in C code?

I bumped into this strange macro code in /usr/include/linux/kernel.h: /* Force a compilation error if conditi

avatar
Fabian
0 1 0 9
asked 07 September, 2021
59 votes
20 answers
1.3K views
How can I profile C++ code running on Linux?

I have a C++ application, running on Linux, which I'm in the process of optimizing. How can I pinpoint wh

avatar
Roger
0 1 0 9
asked 07 September, 2021
58 votes
20 answers
2K views
How to change permissions for a folder and its subfolders/files in one step

I would like to change the permissions of a folder and all its subfolders and files in one step (command) in L

avatar
Tana
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
733 views
How to change the output color of echo in Linux

I am trying to print a text in the terminal using echo command. I want to print the text in a red color. How

avatar
Dusty
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
1.1K views
59 votes
30 answers
1.1K views
How to change the author and committer name and e-mail of multiple commits in Git?

I was writing a simple script in the school computer, and committing the changes to Git (in a repo that was in

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
67 votes
30 answers
2.7K views
Git fetch remote branch

My colleague and I are working on the same repository. We've branched it into two branches, each technica

avatar
Brianne
0 1 0 9
asked 07 September, 2021
61 votes
21 answers
994 views
Ignore files that have already been committed to a Git repository

I have an already initialized Git repository that I added a .gitignore file to. How can I refresh the fil

avatar
Wilber
0 1 0 9
asked 07 September, 2021
53 votes
12 answers
1.3K views
What does cherry-picking a commit with Git mean?

Recently, I have been asked to cherry-pick a commit. So what does cherry-picking a commit in git mean? How d

avatar
Solomon
0 1 0 9
asked 07 September, 2021
50 votes
15 answers
392 views
I ran into a merge conflict. How can I abort the merge?

I used git pull and had a merge conflict: unmerged: _widget.html.erb You are in the middle of a conflicted

avatar
Majorie
0 1 0 9
asked 07 September, 2021
58 votes
29 answers
3.1K views
How do I make Git use the editor of my choice for commits?

I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git to

avatar
Hallie
0 1 0 9
asked 07 September, 2021
57 votes
29 answers
2.4K views
How to find and restore a deleted file in a Git repository

Say I'm in a Git repository. I delete a file and commit that change. I continue working and make some mor

avatar
Hilario
0 1 0 9
asked 07 September, 2021
66 votes
25 answers
1.7K views
Commit only part of a file in Git

When I make changes to a file in Git, how can I commit only some of the changes? For example, how could I com

avatar
Dusty
0 1 0 9
asked 07 September, 2021
48 votes
30 answers
516 views
How to get the current branch name in Git?

I'm from a Subversion background and, when I had a branch, I knew what I was working on with "These worki

avatar
Santiago
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
2K views
Message 'src refspec master does not match any' when pushing commits in Git

I clone my repository with: git clone ssh://xxxxx/xx.git But after I change some files and add and commit

avatar
Luis
0 1 0 9
asked 07 September, 2021
58 votes
24 answers
519 views
How do you create a remote Git branch?

I created a local branch which I want to 'push' upstream. There is a similar question here on Stack

avatar
Rudy
0 1 0 9
asked 07 September, 2021
59 votes
9 answers
546 views
Move existing, uncommitted work to a new branch in Git

I started some work on a new feature and after coding for a bit, I decided this feature should be on its own b

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
57 votes
7 answers
2.4K views
How do I clone a specific Git branch?

Git clone will behave copying remote current working branch into local. Is there any way to clone a

avatar
Tuan
0 1 0 9
asked 07 September, 2021
58 votes
22 answers
3K views
Make an existing Git branch track a remote branch?

I know how to make a new branch that tracks remote branches, but how do I make an existing branch track a remo

avatar
Sena
0 1 0 9
asked 07 September, 2021