LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 03-12-2019, 11:38 PM   #1
MrBright2019
LQ Newbie
 
Registered: Mar 2019
Posts: 3

Rep: Reputation: Disabled
diff --git command returning 'unrecognized' option. Is instruction wrong?


Hello, I need to execute the task below in a Linux Ubuntu VM. Am I missing anything here or maybe the instruction is wrong?
On my VM, I go to directory:
guy@ubuntu:~/sonic-mgmt/ansible$
guy@ubuntu:~/sonic-mgmt/ansible$ git diff
guy@ubuntu:~/sonic-mgmt/ansible$ diff --git a/ansible/veos.vtb b/ansible/veos.vtb
diff: unrecognized option '--git'
diff: Try 'diff --help' for more information.
guy@ubuntu:~/sonic-mgmt/ansible$


Steps to follow is:
lgh@gulv-vm2:/data/sonic/sonic-mgmt/ansible$ git diff
diff --git a/ansible/veos.vtb b/ansible/veos.vtb
index 4ea5a7a..4cfc448 100644
--- a/ansible/veos.vtb
+++ b/ansible/veos.vtb
@@ -1,5 +1,5 @@
[vm_host_1]
-STR-ACS-VSERV-01 ansible_host=172.17.0.1 ansible_user=use_own_value
+STR-ACS-VSERV-01 ansible_host=172.17.0.1 ansible_user=lgh

[vm_host:children]
vm_host_1


Complete documentation:
https://github.com/Azure/sonic-mgmt/...bed.VsSetup.md

Last edited by MrBright2019; 03-12-2019 at 11:39 PM.
 
Old 03-13-2019, 01:18 AM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora, Alpine, Cirros, OpenSuse/SLES
Posts: 2,727

Rep: Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703
You misinterpret the instructions. diff --git is the first output line of the git diff command. You are not supposed to enter this.
 
Old 03-13-2019, 02:41 AM   #3
MrBright2019
LQ Newbie
 
Registered: Mar 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
That said, can you kindly highlight exactly what I am supposed to be typing in the instruction above?
I am running “git diff” and it works. But I dont see any output produced. Help clarifying exactly what i am supposed to be typing is much appreciated.

QUOTE=berndbausch;5973273]You misinterpret the instructions. diff --git is the first output line of the git diff command. You are not supposed to enter this.[/QUOTE]
 
Old 03-13-2019, 03:01 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,266

Rep: Reputation: 3793Reputation: 3793Reputation: 3793Reputation: 3793Reputation: 3793Reputation: 3793Reputation: 3793Reputation: 3793Reputation: 3793Reputation: 3793Reputation: 3793
git diff is the command and all the other lines (from diff --git) are the response.
 
Old 03-13-2019, 07:12 AM   #5
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora, Alpine, Cirros, OpenSuse/SLES
Posts: 2,727

Rep: Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703Reputation: 703
Quote:
Originally Posted by MrBright2019 View Post
That said, can you kindly highlight exactly what I am supposed to be typing in the instruction above?
The lines that have a shell prompt, either $ for normal users, or # for root.
Quote:
I am running “git diff” and it works. But I dont see any output produced. Help clarifying exactly what i am supposed to be typing is much appreciated.
If git diff produces no output, the files that are managed by git are unchanged since the last commit. Since I don’t know sonic-mgmt and its installation procedure, I can’t tell whether this indicates a problem.
 
Old 03-13-2019, 08:33 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 7,507
Blog Entries: 13

Rep: Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017
This is not really a Linux question, git can be used on any type of system. So I will move it to General.

The way I perform git diff is something like:
Code:
$ git diff main/myfile.c
Where the file is under a sub-directory and this would be the matching name. There are tons of options, such as you can use a specific commit to compare your copy against. The most typical thing I might do is to compare a pending changed file, against what the repository currently contains.
 
Old 03-13-2019, 05:00 PM   #7
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,413

Rep: Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600Reputation: 1600
Quote:
Originally Posted by MrBright2019 View Post
I would interpret that as, edit the file ansible/veos.vtb, such that running git diff will show that output. Which is to say, open ansible/veos.vtb in a text editor, find the line saying "STR-ACS-VSERV-01 ansible_host=172.17.0.1 ansible_user=use_own_value" and change it to "STR-ACS-VSERV-01 ansible_host=172.17.0.1 ansible_user=lgh"

Quote:
Modify login user name

Code:
lgh@gulv-vm2:/data/sonic/sonic-mgmt/ansible$ git diff
diff --git a/ansible/veos.vtb b/ansible/veos.vtb
index 4ea5a7a..4cfc448 100644
--- a/ansible/veos.vtb
+++ b/ansible/veos.vtb
@@ -1,5 +1,5 @@
[vm_host_1]
-STR-ACS-VSERV-01 ansible_host=172.17.0.1 ansible_user=use_own_value
+STR-ACS-VSERV-01 ansible_host=172.17.0.1 ansible_user=lgh

 [vm_host:children]
vm_host_1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Gitpod git-bolts git-IDE onto GitHub for in-browser code git-editing LXer Syndicated Linux News 0 09-05-2018 04:50 AM
[SOLVED] git push in a git-init without --bare option? xeon123 Linux - Newbie 1 06-27-2011 03:44 AM
[SOLVED] Can't install Git repo (I don't git git ) Nemus Linux - Software 3 05-20-2011 02:09 PM
setting git-diff --color-words as git-diff potuz Linux - Software 5 09-09-2010 01:31 PM
Which linux instruction is equivalent to windows' instruction "tracert"? backpacker Linux - Software 1 04-04-2006 10:55 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 04:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration