So i've run a heroku create command on my django repo, and currently it is living on Heroku. What I didnt do prior was create my own local git repo. I run git init, create a .gitignore to filter out my pycharm ide files, all the fun stuff.
I go to run git add . to add everything to the initial commit. Odd...it returns:
[1] 4270 killed git add.
So i run git add . again and get back this:
fatal: Unable to create /Users/thefromanguard/thefromanguard/app/.git/index.lock': File exists.
"Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue."
So I go and destroy the file, run it again; same error. Removed the whole repo, repeated the process, still got the same message.
Is Heroku running in the background where ps can't see it?
I would start over.
Destroy the heroku app
heroku apps:destroy --app YOURAPPNAME
Remove the whole repo (I would even remove the directory)
Create new directory, copy files over (do NOT copy old git repo artifacts that may be left over, anything starting with .git)
Initialize your git repo, add files, and commit, then push upstream to your remote (like github, if you're using one) git init && git add . && git commit -m 'initial commit' and optionally git push origin master
Then perform the heroku create
That should remove the conflict.
Related
I'm executing a command 'git push' and get error.
My remote repository is ahead of the local one.
I want to find out what changes have occurred on the remote repository.
Assuming you don't want to pull those changes yet, you can accomplish this with git log. First run git fetch to update your local refs. Then you'll want to run git log my-branch..origin/my-branch. This will show you commits on origin/my-branch (i.e. remote), which do not exist in your local repository.
TLDR: Flask application. When I make changes to the app.py file inside source folder of the bind, the change is reflected in the target folder. But when I hit the API from Postman, the change is not seen unless the container is restarted.
Long Version:
I am just starting with docker and was trying bind mounts. I started my container with the following command:
docker run -p 9000:5000 --mount type=bind,source="$(pwd)"/src/,target=/src/ voting-app:latest
My Dockerfile is as below:
FROM python:3.8.10-alpine
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY ./src ./src
WORKDIR ./src
ENTRYPOINT ["python"]
CMD ["app.py"]
This post mentioned that, if the inode of the file changes, docker cannot handle this especially if it is a single file bind. Mine is not, and the inode was not changing either.
When I run docker exec <container_id> cat app.py, I can see that the changes are carried over to the container file. It is just the API that is not reflecting the change.
Docker version 20.10.17, build 100c701.
Can someone please tell me what I am missing here ? Also, please feel free to ask for more information.
The full code is available here.
When the python file is running, it seems it is not automatically restarted when the file changes. So you need a process to watch the file and restart upon change.
I am working on a python script to automatically sync my workspace if possible and need to judge if I can rebase my changes on top of remote master changes.
I am trying to use the brilliant answer here : https://stackoverflow.com/a/6283843/965830
I want to run the following commands :
Fetch the remote to your repository. For example: git fetch origin master
Run git merge-base: git merge-base FETCH_HEAD master
Run git merge-tree: git merge-tree mergebase master FETCH_HEAD (mergebase is the hexadecimal id that merge-base printed in the previous step)
For command 1, I am using the following successfully
gitRepo = git.Repo(abspath);
gitRepo.remotes.origin.fetch(refspec="master")
However, I am not able to find any documentation for merge-base and merge-tree commands.
------Edit
Found this documentation of merge-tree : https://gitpython.readthedocs.io/en/stable/reference.html?highlight=merge-tree#git.index.base.IndexFile.merge_tree
How can I write this in a way that it doesn't actually perform the merge.
I have a development of a django project on my day-to-day laptop. Now I have put together a server with Ubuntu, nginx, gunicorn with postgreSQL.
I have pip't git on both my laptop and server. And done a 'git init' in my project on the laptop.
Now I am trying to push/deploy this on my local server.
I have done tons of commands that, more or less, look like this
git push --set-upstream ssh://admin#192.168.1.240/home/admin/Django/ master
Do not think I have to say that I am new to all this exciting stuff. It is very interesting, but now my head is foggy and I am stuck.
Pointers in right direction are much appreciated! =)
First you have to add and commit to the current local repo. Try 'git add' and 'git commit' for that.
Next, add the remote "server" machine, use "git remote add", such as:
git remote add origin 192.168.1.240:/home/admin/Django
Finally use the 'git push' command to push the local to the remote:
git push origin master
I am doing the reddit pygame boggle challenge. On my laptop it is in a directory called Boggler, but at sourceforge it is called pygame-boggle. When I do 'git push -u origin master' it gives the error in the title. What am I doing wrong? How do I get it to push?
I followed the instructions here: https://sourceforge.net/p/pygame-boggle/code/ref/master/
Have you initialized the repo? It seems like you haven't.
Run the command git init to set up a git repo. Then, add a remote to your repo (wherever it may be, github or bitbucket or any other site) by running the command
git remote add <url to remote here>