What is the usual approach, should we skip .htaccess file from git repository
Should we add .htaccess file in .gitignore, how we manage this file?
Whether you add
.gitignoredepends on whether you want the
.htaccessfile tracked in your Git repository or not. You have to decide this for yourself, noone can tell you this really.
See also questions close to this topic
Define sequence of branches in Jenkins/Bitbucket CI Pipeline
How do I configure Jenkins to build/deploy a predefined sequence of branches in a linked Bitbucket Server repository?
Here is what I did so far:
I created a repository in an instance of Bitbucket Server on our local network.
There are three branches in the local repository:
master branch second-level-branch-example branch and third-level-branch-example branch
Each branch of the local repository only has one file in it, a
Jenkins Bitbucket Team/Project and Blue Ocean Pipeline
I created a Bitbucket Team/Project in Jenkins running on the same local network and linked it to the Bitbucket Server repository that only contains a
Jenkinsfilein each of the three branches.
Then I clicked the Open Blue Ocean link on the left-hand navigation pane in Jenkins and saw that Jenkins the Jenkinsfile code for all three branches of the linked repository, but in NO PARTICULAR ORDER.
This is not the desired behaviour, because a CI system needs to be able to work on branches in a specific order.
How Do You Define The Order Of Branches?
What specific configuration must be created in order to configure Jenkins to:
1. process only one branch of the repository at a time before waiting for further instructions, and
2. process successive branches in a predefined order.
For example, the pipeline should:
1. First run on the
2. Then second run on the
3. Then third run on
Of course, if a run on one of the branches fails, then the pipeline would stop and NOT run on the next branches.
Stop "git branch" opening an editor
I just updated my git installation today and noticed a new behavior:
When I run
git branch, git opens up an editor (
lesson my machine), whereas previously it simply prints to screen the results.
Is there a way to restore to the old behavior, i.e. prints to screen? Thanks!
Local git branch seems fine. Remote branch no longer appears on Github, but can be pushed/pulled to from
Yesterday, I added a local branch. I committed to it and pushed it to Github.
Today, I looked at Github and the branch is gone. It is called '430_042018_jam1'. As you can see, only the master branch appears in the listing.
Of course, the local 430_042018_jam1 branch is still around. So, in order to examine, I pulled to it from Github.
Tars: MaterialsRepo jammy$ git pull origin 430_042018_jam1 From github.com:blahblah/training_materials * branch 430_042018_jam1 -> FETCH_HEAD Already up-to-date.
The pull worked fine. I made a dummy change, committed, and pushed to the Github repo. This worked fine as well, as you can see.
Tars: MaterialsRepo jammy$ git push origin 430_042018_jam1 Counting objects: 2, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (2/2), 367 bytes | 0 bytes/s, done. Total 2 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), done. To email@example.com:blahblah/training_materials.git 0eadbaf..1c5d8fd 430_042018_jam1 -> 430_042018_jam1
I went back to Github and refreshed my page. The 430_042018_jam1 branch still wasn't appearing in the list of branches. I logged out of Github and then back in. Still, no 430_042018_jam1 branch.
So, finally, my question is: does anyone know what has happened? My branch seems to be in some pseudo-state where Github, in some sense, knows it exists, and yet, it doesn't appear within the list of branches for the repo.
How to put back the WAMP server Offline? Where is the option?
I installed Wamp 3.1.3 64 bit.
There are 3 icon colour basically in WAMP red,orange & green
These functionality is also known to me,so not describing.
But there is also another icon a green back with red dot and yellow lines. By google-ing I came to know that for Indicating The Server is Online. So Every thing is ok till now. I put my server Online.
But the problem is now how can i put the server back to offline? I can't find any PUT OFFLINE option. I tried with editting the
files by setting everything-
But Nothing changes . I also restarted the whole system. The Icon is same.
So how can i Put this back offline? Edit: I want to make it back local only ie the color of icon back to green only and services should run and server works locally.
Run NodeJs and Apache together with two separated domain
I have a Linux server (VPS) with two domains and two web applications, one programmed with
NodeJS(chat app) whereas the another is
So, what I want to do is running the two applications in separated domains on the same server. I've tried many methods to do this but all these methods working on single domain and multi URL path like :
But what I want is like this:
htaccess rewrite rule redirects with wrong Server Name
We are using lines like
RewriteRule ^folder/(.+)?$ folder/$1 [L]
in our htaccess file. Our Server_Name is naturally "bad-server-name" but we use a CDN to block out traffic to "bad-server-name" and use "good-server-name" instead. When I go to "https://good-server-name.com/bot" it should redirect to "https://good-server-name.com/bot/" but it 301 redirects to "https://bad-server-name.com/bot/". Using our CDN we have a server header that stores "good-server-name". Is there a way to make the htaccess file redirect to "https://good-server-name.com/bot/"?
RewriteRule for special characters
I have checked through the threads all day and cant make this work.
When i input "ö" in my search box the the url result become "%25C3%25B6"
So I search for "Örebro" and the search gives "%25C3%25B6rebro"
I try fix this with htaccess.
This is what I tried and many other options but nothing works.
RewriteRule ^%25C3%25B6(.*) ö$1 [L,R=301]
This is how my url looks like:
I need it like this
I can make it work when is a simple word but it do not work when it contain special characters.
.htaccess rewrite when form submission
Let's say I have a website where the main page (index.php) of this website has a simple form. It's a text box where you enter a country, and submit it. It submits to results.php by GET. This page, given that the country exists, outputs a list of elements associated with that country.
So you go to example.com, you enter "Argentina" into the form and submit it. The browser makes a request to
example.com/result.php?country=Argentina, and there you see the results.
But I would like to do this by routing/rewriting. So instead of the page listing the elements for Argentina being located at the URL
example.com/result.php?country=Argentina(Long And Ugly), I want it to be located at
example.com/Argentina(Short And Sweet).
One way of half way achieving this is through rewriting in the .htaccess like this:
RewriteRule ^([^/]+)/?$ result.php?country=$1 [NC]
Now I can go to the SAS URL and see the same page as if I went to the LAU URL. Great for linking and SEO. But as index.php submits a form to result.php, if I actually do the search for Argentina from the main page, I will still be taken to the LAU URL, and not the SAS URL.
I know one way to get around this is to instead make a rewrite rule that takes the LAU URL and redirects to the corresponding SAS URL, and also have a rule sending all SAS URLs to result.php, and let result.php handle the parameters by exploding
$_SERVER['SCRIPT_NAME']. But somehow, this doesn't seem very clean. Is there a better way, that ensures I will also see the SAS URL when submitting the form?
Git: How to ignore some files to push/ pull /merge changes
I am using git inside a project. The project contains a file which contains some configuration specific to the local machine of each developer. Git already has a version of this file. I have the updated copy of that file as per my need and now I do not want to change the content of this file by any
I can not do git remove to that file and move it to outside the project . So this can not solve my problem
.gitignore file Permission denied
I do not know what I did but I keep getting this error. I had two remotes origin and test of a local copy of a repository. I deleted the test remote and I wanted to use back again the origin. And now I get an error like
unable to access .gitignore. Permission denied
And when I want to push some commits I am getting
error: failed to push some refs to 'https://github.com/me/Test' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
GIT ignore files
I have a project for example
testproject I have another project
How to do ignore some files from
test2? I can only ignore all project
testbut I want to only some files from
project-test1 project-test2 someFiles in project