FAQ

IndexTagsArchivesAbout
  • Updates were rejected because the tip of your current branch is behind its remote counterpart

    2022-08-03

    Question Our workflow is such. We have a branch called dev which I can reach at origin/dev. When we do changes, we create a branch off dev: git checkout -b FixForBug origin/dev Now I have a branch called FixForBug which is tracking (I think that's the right word) origin/dev. Thus, if I do a git pull it'll bring in new changes from origin/dev which is great. Now, when I'm finished with my fix, I push to a remote branch called the same thing.…

    #git

  • Using GitLab token to clone without authentication

    2022-08-03

    Question I want to clone GitLab repository without prompt for my automation script, by using my private token from my GitLab account. Can someone provide me a sample? I know I can do so with user and password: git clone https://" + user + ":" + password + "@" + gitlaburl; and I know it is possible with ssh key But, both options are insufficient. Answer This is how you do it:…

    #git

  • Where does the .gitignore file belong?

    2022-08-03

    Question Does the .gitignore file belong in the .git folder structure somewhere or in the main source files? Answer Put .gitignore in the working directory. It doesn't work if you put it in the .git (repository) directory. $ ls -1d .git* .git .gitignore

    #git

  • Change branch base

    2022-08-02

    Question I've a tree like this: (commit 1) - master \-- (commit 2) - (commit 3) - demo \-- (commit 4) - (commit 5) - PRO and I have to move the PRO branch to master (commit 1) - master |-- (commit 2) - (commit 3) - demo \-- (commit 4) - (commit 5) - PRO I've tried a git rebase master from PRO branch, but nothing happens. To clarify: I was working in master and then I had to make a product demo (git checkout -b demo and some commits).…

    #git

  • Check if pull needed in Git

    2022-08-02

    Question How do I check whether the remote repository has changed and I need to pull? Now I use this simple script: git pull --dry-run | grep -q -v 'Already up-to-date.' && changed=1 But it is rather heavy. Is there a better way? The ideal solution would check all the remote branches, and return names of the changed branches and the number of new commits in each one. Answer First use git remote update, to bring your remote refs up to date.…

    #git

  • Clone private git repo with dockerfile

    2022-08-01

    Question I have copied this code from what seems to be various working dockerfiles around, here is mine: FROM ubuntu MAINTAINER Luke Crooks “luke@pumalo.org” Update aptitude with new repo RUN apt-get update Install software RUN apt-get install -y git python-virtualenv Make ssh dir RUN mkdir /root/.ssh/ Copy over private key, and set permissions ADD id_rsa /root/.ssh/id_rsa RUN chmod 700 /root/.ssh/id_rsa RUN chown -R root:root /root/.ssh Create known_hosts RUN touch /root/.ssh/known_hosts…

    #bash

  • Trying to fix line-endings with git filter-branch, but having no luck

    2022-08-01

    Question I have been bitten by the Windows/Linux line-ending issue with git. It seems, via GitHub, MSysGit, and other sources, that the best solution is to have your local repos set to use linux-style line endings, but set core.autocrlf to true. Unfortunately, I didn't do this early enough, so now every time I pull changes the line endings are borked. I thought I had found an answer here but I can't get it to work for me.…

    #git

  • «
  • 96
  • 97
  • 98
  • 99
  • 100
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^