Searching past program codes

GoodBetterBest

Supremacy Member
Joined
Jan 23, 2019
Messages
6,239
Reaction score
2,119
Hi !
I'm learning programming. And along the way, I will have useful samples, or practices codes that I've written. I want to keep track of these codes and search them when I need. I don't intend to use repo like Github for this.
I don't have a place to keep them so that I can easily find the codes I want.
Just want to find out where you keep your codes ?

Thanks..
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
Hi !
I'm learning programming. And along the way, I will have useful samples, or practices codes that I've written. I want to keep track of these codes and search them when I need. I don't intend to use repo like Github for this.
I don't have a place to keep them so that I can easily find the codes I want.
Just want to find out where you keep your codes ?

Thanks..

Keep in your own hard disk ? :)
What are you expecting, when you don't want to use a code version control system. Just store it in your own storage devices.

If what you mean is you don't want to store into a public SVC system, you can always setup your own. If you just want a repo local to your system, you don't need to push into a remote GIT, you can just keep your source code tracked locally

Once your perform a "git init", all commits to the code are already locally tracked. You can simply just tar up the whole parent directory that contains all your numerous local git repos and store it elsewhere as backup.

Code:
$ git init project1
Initialized empty Git repository in /Users/davidktw/WORK/GITDEMO/project1/.git/
$ cd project1
$ echo def > abc
$ git add .
$ git commit -a --allow-empty-message -m ''
[master (root-commit) 46ad841]
 1 file changed, 1 insertion(+)
 create mode 100644 abc
$ git log
commit 46ad841480cf34f5c58135df738a5bddb343466f (HEAD -> master)
Author: XXX <YYY>
Date:   Wed Mar 24 16:51:59 2021 +0800
$ cd ..
$ ls
project1

$ git clone ssh://davidktw@localhost:/Users/davidktw/WORK/GITDEMO/project1 project2
Cloning into 'project2'...
Password:
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
$ ls
project1 project2
$ cd project2/
$ git log
commit 46ad841480cf34f5c58135df738a5bddb343466f (HEAD -> master, origin/master, origin/HEAD)
Author: XXX <YYY>
Date:   Wed Mar 24 16:51:59 2021 +0800
$ ls
abc
$ cat abc
def

Simple demonstration to you that all you need is a *nix box and you can just store your projects in it. You can easily just clone out from another simple using ssh to connect to a remote repository which is as simple as a remote *nix box. There is no extra software you need except installing the GIT.

Have fun. :)
 
Last edited:

GoodBetterBest

Supremacy Member
Joined
Jan 23, 2019
Messages
6,239
Reaction score
2,119
My intention is to find a system that could help me easily find the codes. If I store it in Git and it's also on my file system, I think it may not make it easier for me to find the codes.

I don't if there is an application that caters to such needs, instead of searching filenames and inside the file.

Thanks again.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
My intention is to find a system that could help me easily find the codes. If I store it in Git and it's also on my file system, I think it may not make it easier for me to find the codes.

I don't if there is an application that caters to such needs, instead of searching filenames and inside the file.

Thanks again.

Use your IDE. Any decent IDE can search through the codes and files in the project once it is indexed. If not, go try out gitlab.
 
Last edited:

moolala

Arch-Supremacy Member
Joined
Mar 2, 2020
Messages
12,242
Reaction score
948
Keep in your own hard disk ? :)
What are you expecting, when you don't want to use a code version control system. Just store it in your own storage devices.

If what you mean is you don't want to store into a public SVC system, you can always setup your own. If you just want a repo local to your system, you don't need to push into a remote GIT, you can just keep your source code tracked locally

Once your perform a "git init", all commits to the code are already locally tracked. You can simply just tar up the whole parent directory that contains all your numerous local git repos and store it elsewhere as backup.

Code:
$ git init project1
Initialized empty Git repository in /Users/davidktw/WORK/GITDEMO/project1/.git/
$ cd project1
$ echo def > abc
$ git add .
$ git commit -a --allow-empty-message -m ''
[master (root-commit) 46ad841]
1 file changed, 1 insertion(+)
create mode 100644 abc
$ git log
commit 46ad841480cf34f5c58135df738a5bddb343466f (HEAD -> master)
Author: XXX <YYY>
Date:   Wed Mar 24 16:51:59 2021 +0800
$ cd ..
$ ls
project1

$ git clone ssh://davidktw@localhost:/Users/davidktw/WORK/GITDEMO/project1 project2
Cloning into 'project2'...
Password:
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
$ ls
project1 project2
$ cd project2/
$ git log
commit 46ad841480cf34f5c58135df738a5bddb343466f (HEAD -> master, origin/master, origin/HEAD)
Author: XXX <YYY>
Date:   Wed Mar 24 16:51:59 2021 +0800
$ ls
abc
$ cat abc
def

Simple demonstration to you that all you need is a *nix box and you can just store your projects in it. You can easily just clone out from another simple using ssh to connect to a remote repository which is as simple as a remote *nix box. There is no extra software you need except installing the GIT.

Have fun. :)
this system very complicated for newbies :(

i just use the IDE and search
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,547
Reaction score
1,301
this system very complicated for newbies :(

i just use the IDE and search
Understanding VCS is a software engineering skill set, especially so when working in a community or team, and necessity if you are developing with accordance to a mature software development lifecycle that requires tracking and versioning across it. It is indispensable unless you like to do manual work. :)

In this topic, searching is a topic on its own. But a decent VCS also offers searching temporally which is not what TS is asking for. I merely suggested GIT because it works well with good IDE and allows for remote storage just like how github does. :)
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top