Sponsored Content
Top Forums Shell Programming and Scripting Perform action in dir if dir has .git subdir Post 302424012 by dragon.1431 on Monday 24th of May 2010 09:17:57 AM
Old 05-24-2010
MySQL

hi,

project dir will be something like this:
Code:
/home/user/Source
/home/user/Source/Main_A
/home/user/Source/Main_A/.git
/home/user/Source/Main_A/Test/.git
/home/user/Source/Main_B/.git
/home/user/Source/Main_B/Test
/home/user/Source/Main_B/Test/xyz
/home/user/Source/Main_B/Test/xyz/abc
/home/user/Source/Main_B/Test/xyz/abc/.git

Below mentioned two folders do not have .git subdir so those two should be skipped.
Code:
/home/user/Source/Main_B/Test
/home/user/Source/Main_B/Test/xyz

My output log will be like this:
---------
/home/user/Source
On branch master
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)

till

/home/user/Source/Main_B/
On branch master
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)

/home/user/Source/Main_B/Test/xyz/abc/
On branch bug_fix
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
---------
Please note that /home/user/Source/Main_B/Test/xyz/abc/ has ".git" subdir.
ie /home/user/Source/Main_B/ is parent git, /home/user/Source/Main_B/Test/xyz/abc/ is child1 git.

---------- Post updated at 03:42 AM ---------- Previous update was at 02:23 AM ----------

hi again,

right now im using repo command for the same
repo forall -c "git status" > status.log

In log file i DO NOT get the folder path in which git the files are modified/added/deleted.Hmm, i can get folder path of added/modified files with find/locate command.

For deleted files how do i get the folder path.

Any thoughts Smilie

---------- Post updated at 08:17 AM ---------- Previous update was at 03:42 AM ----------

Smilie

Last edited by Yogesh Sawant; 05-24-2010 at 04:27 AM.. Reason: added code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

a script to clone a dir tree, & overwrite the dir struct elsewhere?

hi all, i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ... specifically, i'd like to: (1) specify a src directory (2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs (3) clone that same, empty dir hierarchy to... (2 Replies)
Discussion started by: OpenMacNews
2 Replies

2. Shell Programming and Scripting

moving dir subdir and files

I have created a directory structure and under the directory subdirectories and files are there.I need to move the entire thing to another path.How can i write a script to do that. currently the path of files is as below : /data1/serial/mcycle/archive : under this path differnt sub dir exist ... (6 Replies)
Discussion started by: dr46014
6 Replies

3. Shell Programming and Scripting

replace string in multiple files, dir and subdir

Hello, I have a directory www with multiple directories. Every directory has site name with .htm, .html, .php files or sub directories with .htm, .php, .html file as example - www - sitename 1 - site 1 - sitename 2 - sitename 3 What I'm looking for is a... (7 Replies)
Discussion started by: andyjill
7 Replies

4. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

5. Shell Programming and Scripting

create dir in main &subdirs,perform action

Hi, I have one dir which has N subdirs.For ex: /home/user/Project_Src /home/user/Project_Src/Dir_A /home/user/Project_Src/Dir_A/subdir/sub_dir2 /home/user/Project_Src/Dir_A/subdir/sub_dir3 /home/user/Project_Src/Dir_B /home/user/Project_Src/Dir_B/Build i want to create a folder with... (2 Replies)
Discussion started by: dragon.1431
2 Replies

6. Shell Programming and Scripting

KSH - Find paths of multiple files in CC (dir and sub-dir))

Dear Members, I have a list of xml files like abc.xml.table prq.xml.table ... .. . in a txt file. Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file. Please help me with the script or command to do so. ... (11 Replies)
Discussion started by: Yoodit
11 Replies

7. Shell Programming and Scripting

Move all files from dir and subdir to Archive with File name as complete path_filename

HI, I need to move all files from a dir & its all subdir to Archive folder which is indise dir only. and moved filename should changed to complete path ( Like Dir_subdir_subdir2_.._filename ). also all files names shoud capture in a file in order to mail I written below code ... (11 Replies)
Discussion started by: minijain7
11 Replies

8. UNIX for Dummies Questions & Answers

copying the dir/subdir structure from one server to another?

Hi All, I want to copy the dir/subdir structure from SERVER-A to SERVER-B without copying all the files in each dir. Is it possible using SCP / SFTP command? For example, SERVER-A has following two dir/subdirectories and files under each subdir. ... (1 Reply)
Discussion started by: Hangman2
1 Replies

9. UNIX for Dummies Questions & Answers

How do I create a tar file for only dir and its subdir structures??

How do I create a tar file for only dir and its subdir structures?? (4 Replies)
Discussion started by: vx04
4 Replies

10. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies
GIT-CREDENTIAL-CAC(1)						    Git Manual						     GIT-CREDENTIAL-CAC(1)

NAME
git-credential-cache - helper to temporarily store passwords in memory SYNOPSIS
git config credential.helper 'cache [options]' DESCRIPTION
This command caches credentials in memory for use by future git programs. The stored credentials never touch the disk, and are forgotten after a configurable timeout. The cache is accessible over a Unix domain socket, restricted to the current user by filesystem permissions. You probably don't want to invoke this command directly; it is meant to be used as a credential helper by other parts of git. See gitcredentials(7) or EXAMPLES below. OPTIONS
--timeout <seconds> Number of seconds to cache credentials (default: 900). --socket <path> Use <path> to contact a running cache daemon (or start a new cache daemon if one is not started). Defaults to ~/.git-credential-cache/socket. If your home directory is on a network-mounted filesystem, you may need to change this to a local filesystem. CONTROLLING THE DAEMON
If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action: git credential-cache exit EXAMPLES
The point of this helper is to reduce the number of times you must type your username or password. For example: $ git config credential.helper cache $ git push http://example.com/repo.git Username: <type your username> Password: <type your password> [work for 5 more minutes] $ git push http://example.com/repo.git [your credentials are used automatically] You can provide options via the credential.helper configuration variable (this example drops the cache time to 5 minutes): $ git config credential.helper 'cache --timeout=300' GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 GIT-CREDENTIAL-CAC(1)
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy