119 questions
2
votes
1
answer
89
views
Understanding git rm
I am trying to understand "git rm" command.
So I have a file Test.txt in my local directory/ current working directory
I did
git add .
git commit -m "1st commit"
Now, the file is ...
0
votes
0
answers
102
views
Is there a way to delete folders through GitLab from master branch, but keep them in other branches?
I'm sure this is a stupid question but I have very little background with git and everything I've learned has been done on the fly and independently, so I'm very much still learning.
I have a ...
1
vote
0
answers
224
views
Removing a submodule manually
I tried removing manually the following submodule from my local repository:
components/CtrlFuelSuppHtr
Removed it from these three places: .git folder, components folder, and deleted it on .gitmodules....
0
votes
0
answers
8k
views
Running "git rm --cached" removes files from the .git folder?
I'm having trouble understanding what does git rm --cached do.
For example, I have a beagle_pft_test repo and a list of submodules inside "components folder". doing git rm --cached would ...
2
votes
0
answers
186
views
How to remove a submodule from git so that it is deleted from the file system on pull
I have a submodule named my_submodule, which I would like to delete. I need to make sure that it is removed from other developers' file systems as well, to prevent accidentally using it.
I can't ...
0
votes
0
answers
1k
views
Issues deleting git file after pushing
I am trying to delete a file after git push. I initially tried to git rm myFile, but this resulted in deleting the file locally and not deleting the file from my repo. When I click on my branch, I see
...
0
votes
1
answer
43
views
Problem/Confusion about merging branches and "modify/delete" Conflicts
Here's the hierarchy of the 3 Branches in this story:
"master" branch
|
JohnReedAvery
|
Birdy
Earlier today, I finished a couple of scripts in the "Birdy&...
1
vote
2
answers
228
views
git add/rm files based on the type of change (of the files)
Is there a way to stage or unstage (git add / git rm) files only based on what was the type of modification?
Like :
add/rm only files that are deleted
add/rm only files that are new
add/rm only files ...
1
vote
2
answers
2k
views
what does git rm do as opposed to deleting by OS and git add
If we want to delete a file (say file1.txt) and stop the git repo to track it, it is said that we should use git rm file1.txt and then git commit -m "..." it. But deleting from the working ...
0
votes
1
answer
180
views
Move a file from a directory with one file to another (refactoring)
I have a directory with a single file Foo.java defining a class under package com.a.b.c under a specific package i.e. src/com/a/b/c/Foo.java
I want to refactor and move the class in a different ...
-1
votes
2
answers
316
views
how can git commit -a work after i remove a file from index
Suppose I have tracked file empty.txt.
Now I remove file from working directory using rm empty.txt .
Now I am removing file from index using git rm empty.txt and now file should be untracked since I ...
0
votes
3
answers
2k
views
Undo .gitignore changes
I previously ignored a folder, but now I would like to ignore its content only: How do I remove/modify some entries from my .gitignore file so that git will track them again? I tried updating the ...
0
votes
0
answers
43
views
how to not pull a file that commited?
I have a zip file (contains jdk) that is already committed to the remote repo,
I only use this file in the remote repo (as a cicd procedure)
and what I want is that I will not be able to pull it (the ...
1
vote
1
answer
2k
views
Easily remove multiple tracked files and add them to gitignore with VSCode
I have a folder with many files tracked by git, and I would like to untrack many of theses files in a simple way.
Usually when I compile my solution, I see from VSCode source control tab some tracked ...
28
votes
2
answers
18k
views
What's the difference between 'git rm --cached', 'git restore --staged', and 'git reset'
I have come across the following three ways in order to unstage the files that were staged by the command 'git add'
git rm --cached <file>
git restore --staged <file>
git reset <file>...