I am stuck with this problem.
I have a list of files inside a folder which is inside another folder in github. The goal is to open all the folder and read the files inside each of those folders with the latest git commit.
Please help.
FOLDER1
--- Folder a
------ file a1
------ file a2
--- Folder b
------- file b1
------- file b2
I want to iterate all folders inside Folder1 and read contents of file with the latest commit ID in each sub-folder.
Related
I have a folder called 'Development' with subfolders 'a' and 'b' in my Pycharm project. However, when I look at the folder structure in Gitlab with the browser, the folder is split into "Development" (Capital initial letter) with subfolder "a" and "development" (small initial letter) with subfolder "b". I tried to merge the folders in Gitlab using checkout main and push into main. But that didn't change anything and when I'm in the main branch with the Pycharm IDE, I can only see the folder 'Development' with the two subfolders 'a' and 'b'.
In Pycharm:
Project/
Development/
a/
b/
In Gitlab:
Project/
Development/
a/
development/
b/
This structure was created automatically in Git. I never created it this way.
How can I merge the two folders in the Gitlab repository?
I have already made a GitHub repository with a folder1, but I have a ../etc/etc/folder2 that I would like to add into the same repository because they both are a part of the same project.
As you can see these two folders are not super close to each other, but they are in the same linux file system. How can I add folder2 to my existing GitHub repository that contains folder1?
What I ended up doing was creating the repository in the root directory.
I created a .gitignore file to ignore all files except the two folders that I wanted in the repository.
## Ignore everything...
*
## Except...
folder1
folder1/*
path/to/folder2
path/to/folder2/*
You would need to, locally on your Linux machine, move or copy the folder2 in your local cloned repository, add and commit.
Then you can push, in order to see folder2 in your remote GitHub repository.
The alternative is:
make a Git repository in ../etc/etc/folder2, push it to a separate GitHub repo folder2
reference the remote GitHub repository folder2 as a submodule in your first local cloned repository
That is:
cd /path/to/folder1
git submodule add -b main -- https://github.com/<me>/folder2
That way, you have the repo folder2 referenced by your main repository.
If you change anything in folder2 (original path), add, commit and push.
Then, from the first local cloned repository, git submodule update --remote is enough to update the folder2 submodule content.
Currently, I am using GitKraken to upload my files to Gitlab. However, there was a submodule that contained all my files for the project - in an attempt to combine the submodule into the main respiratory, I tried deleting it; however, my entire submodule is gone now. When I go into the trash folder of my Mac, I can see the folder except it is named with extra letters and contains files such as Build and Test Index. Is there anyway to get this submodule back?
UPDATE: I tried reverting the files from the trash folder, but it only put the files back into the derived data folder. Not sure how to get the submodule back, it is asking to initialize it by specifying a URL.
I'm trying to use CVS on my linux machine for the first time for a project, and I keep hitting my head against the same brick wall.
I have created a projects directory as /home/myuser/cvsproject
I then set the environment variable for CVS as:
export CVSROOT=/home/myuser/cvsproject
I then ran the initialize for CVS as: cvs init
This created the CVSROOT folder under my projects directory.
I then created a lower level project directory, as /home/myuser/cvsproject/project1
I added these project details in the modules file at the end as
project1 project1
I am now trying to add a new file to the repository with cvs add project1/filename.txt but I get the following error:
cvs add: in directory project1:
cvs [add aborted]: there is no version here; do 'cvs checkout' first
The file is in my current directory, located in /home/myuser/cvsproject/
If I try to add the file without the project1 prefix: cvs add filename.txt I get the same error still.
I am able to check out a file in the CVSROOT directory, i.e.
cvs checkout CVSROOT/modules so CVS is definitely working.
I appreciate any help. Thanks
CVS is not decentralised, you shouldn't make your project directory the root of CVS repository. Set CVSROOT to different place where your repository will reside (that is not the same place as your project's working directory - it should be some place new, where CVS will create its structure), then add or import everything you need (don't forget to commit). If you want another working copy, you should checkout from the same CVSROOT.
I'm new to Git, and i want to push some files to one repo and other files to another repo, but when i do the second push it goes with the files of the first repo. How can i push the the files separately?
Should you have .git directories in each your project directories. And don't forget for use git bash inside directories what you want to push. Example:
Project A in
C:/projectA
inside projectA you have .git directories(hidden files)
Project B in
C:/projectB
inside projectB you have .git directories(hidden files)
for push project A, try this
cd c:
cd projectA
you stay in projectA, and then push.