FAQ

IndexTagsArchivesAbout
  • Git Push ERROR: Repository not found

    2022-02-22

    Question I am having a very strange problem with git and github. When I try and push, I am getting: git push -u origin master ERROR: Repository not found. fatal: The remote end hung up unexpectedly I added the remote: git remote add origin git@github.com:account-name/repo-name.git Any ideas? Answer Check to see if you have read-write access. The Git error message is misleading. I had a similar issue. I had been added to an existing project.…

    #git

  • Force "git push" to overwrite remote files

    2022-02-21

    Question I want to push my local files, and have them on a remote repo, without having to deal with merge conflicts. I just want my local version to have priority over the remote one. How can I do this with Git? Answer You should be able to force your local revision to the remote repo by using git push -f <remote> <branch> (e.g. git push -f origin master). Leaving off <remote> and <branch> will force push all local branches that have set --set-upstream.…

    #git

  • How to restore the permissions of files and directories within git if they have been modified?

    2022-02-21

    Question I have a git checkout. All the file permissions are different than what git thinks they should be therefore they all show up as modified. Without touching the content of the files (just want to modify the permissions) how do I set all the files permissions to what git thinks they should be? Answer Git keeps track of filepermission and exposes permission changes when creating patches using git diff -p.…

    #git

  • Undo a Git merge that hasn't been pushed yet

    2022-02-21

    Question I accidentally ran git merge some_other_branch on my local master branch. I haven't pushed the changes to origin master. How do I undo the merge? After merging, git status says: # On branch master # Your branch is ahead of 'origin/master' by 5 commits. How do I undo all these commits? Answer With git reflog check which commit is one prior the merge (git reflog will be a better option than git log).…

    #git

  • Git pull after forced update

    2022-02-20

    Question I just squashed some commits with git rebase and did a git push --force (which is evil, I know). Now the other software engineers have a different history and when they do a git pull, Git will merge. Is there a way to fix this, except doing a rm my-repo; git clone git@example.org:my-repo.git? I need something like the opposite of git push --force, but git pull --force did not give the intended results.…

    #git

  • Is it possible to move/rename files in Git and maintain their history?

    2022-02-20

    Question I would like to rename/move a project subtree in Git moving it from /project/xyz to /components/xyz If I use a plain git mv project components, then all the commit history for the xyz project gets lost. Is there a way to move this such that the history is maintained? Answer Git detects renames rather than persisting the operation with the commit, so whether you use git mv or mv doesn't matter, as long as the move operation is committed separately from any changes to the file.…

    #git

  • .gitignore and "The following untracked working tree files would be overwritten by checkout"

    2022-02-19

    Question So I added a folder to my .gitignore file. Once I do a git status it tells me # On branch latest nothing to commit (working directory clean) However, when I try to change branches I get the following: My-MacBook-Pro:webapp marcamillion$ git checkout develop error: The following untracked working tree files would be overwritten by checkout: public/system/images/9/thumb/red-stripe.jpg public/system/images/9/original/red-stripe.jpg public/system/images/8/thumb/red-stripe-red.jpg public/system/images/8/original/red-stripe-red.jpg public/system/images/8/original/00-louis_c.k.-chewed_up-cover-2008.jpg public/system/images/7/thumb/red-stripe-dark.jpg public/system/images/7/original/red-stripe-dark.jpg public/system/images/7/original/DSC07833.JPG public/system/images/6/thumb/red-stripe-bw.jpg public/system/images/6/original/website-logo.png public/system/images/6/original/red-stripe-bw.jpg public/system/images/5/thumb/Guy_Waving_Jamaican_Flag.jpg public/system/images/5/original/logocompv-colored-squares-100px.png public/system/images/5/original/Guy_Waving_Jamaican_Flag.…

    #git

  • «
  • 136
  • 137
  • 138
  • 139
  • 140
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^