git-add

git bash shell on Windows “Your edited hunk does not apply” (continued)

给你一囗甜甜゛ 提交于 2019-12-13 12:21:57
问题 Not too long ago, I asked this question. I received an answer, but it did not solve the issue I was having, so I was advised to create a new question with more detail. Just to reiterate, I am getting an error when trying to manually edit a hunk in the Git bash shell on Windows, when using git add -p (specifically, I press e when prompted by the interactive command). This opens an edit file for the hunk in Notepad++ (my default .txt editor). Even without making any changes to this file, I am

Git add all files also from nested git repos

梦想与她 提交于 2019-12-12 20:44:04
问题 My dotfiles repository has some tmux plugin directories which are themselves git repositories. When I do git add -all these nested repos are ignored. Is there a way to ignore the git semantics of these nested repos and treat everything as regular files? 回答1: You may be looking for the Git feature called submodules. This feature helps you manage dependent repositories that are nested inside your main repository. Answer from here Also you might want to check the .gitignore files you might have.

How to add an existing nested repo (already checked out in a subdir) to a parent Git repo as a submodule?

怎甘沉沦 提交于 2019-12-12 10:37:44
问题 What happens if I'm creating the initial commit from my working (parent) directory, but there are subdirs with independently checked-out git repos? I simply did git add . but that brought me to a strange situation when the subdirs with nested Git repos are not registered as submodules of the parent repo. So: how to proceed after an initial "git add ." in a parent working dir where there have been subdirs with independetly checked-out nested git repos (in order to get correct submodules)? An

How do I place a dummy file in a git repo?

怎甘沉沦 提交于 2019-12-12 07:58:25
问题 I'm new at git so please bear with me. Say i have a file under version control that includes sensitive data. Sure enough, I put that file in my .gitignore file, so it doesn't get pushed to the repo. The problem now is somewhere in my project i have a line like #include <sensitivedata> or whatever your language of choice is. The problem is whenever somebody clones from that repo, that file is missing and he gets a fatal error when trying to build / compile the solution. So, instead of pushing

Unable to add folder to git repo

狂风中的少年 提交于 2019-12-11 17:19:27
问题 I think this issue has already been discussed under this question : Recursively add the entire folder to a repository However I still can not add some folders to a git repository and I need help. $ git status ... # modified: folder_to_add1 (modified content, untracked content) # modified: folder_to_add2 (modified content, untracked content) These folders originally belonged to another git repository, so I entered the folders and deleted the .git folder inside. I then ran: $ git add folder_to

Git: Undo local changes; git add . + git rm?

半世苍凉 提交于 2019-12-09 04:41:01
问题 Need help figuring out a couple common workflows with Github. I come from a VS TFS background, so forgive me. Undoing Pending Changes Let's say I have cloned of a git repository to my local file system. At this point, the project's local files match exactly what's in the remote repoistory. Then I decided to make some changes to the code, and change the local versions of a couple files. After doing some testing, I figure out that I want to discard my local changes and revert the local files

Git adding “unchanged” files to the stage

左心房为你撑大大i 提交于 2019-12-08 17:02:37
问题 For a project I'm working on, I want to use: git add . -A to add some files to the stage. The problem is that Git thinks these files are unchanged from the last commit, so they are ignored. However, I personally changed the file, but Git still sees the file as unchanged. How can I "forcefully" add that single file to my repository? 回答1: check your .gitignore file there must be some pattern matching this file which is excluding file from being staged. Or you can use git add . -f to forcely add

How do I add the src directory instead of the individual files?

若如初见. 提交于 2019-12-08 12:22:58
问题 I've created a directory called 'src' which contain the files 'level.txt' and 'notes.txt': Remys:git-practice Remyce$ cd src Remys:src Remyce$ ls level.txt notes.txt How do I add the src directory instead of the individual files? It keeps coming up with: Remys:src Remyce$ add src -bash: add: command not found I also need to commit the files to the repo. 回答1: Go back to your git-practice directory, then git add src git status git commit -m "created a directory called which contain the files"

git bash shell on Windows “Your edited hunk does not apply”

六月ゝ 毕业季﹏ 提交于 2019-12-08 04:13:45
问题 I have a very frustrating error when trying to manually edit hunks while using the command: git add -p I have already looked through many of the existing questions on this site, including this one, and this one. I am at the point where I try to manually edit a hunk, make no changes to the file opened by git for manual editing, and still getting the error "Your edited hunk does not apply". I thought this might have to do with CRLF vs. LF EOL characters. I am editing in Notepad++, and I can see

Git - Can't Push - “! [remote rejected] master -> master (Working directory has unstaged changes)”

孤者浪人 提交于 2019-12-07 06:13:27
问题 I am trying to set up a "simple" git workflow for a Wordpress installation that has a local version, a staging version and a production version. All I want to do is make changes locally and push from local to staging and from local to production. At first I thought this would be a simple task. I have been able to initialize the repository, add the two remotes "staging" and "production", initialize git on the remotes and push changes from my local version to the staging and production servers