Im using jenkins to pull a git repo then deploy all folders to a remote server. But the problem is I want to push all folders including its subfolders which may contain its own subfolder and so on.
I tried to use **/**/* for source files filed but it is ommitting some folder specially in sub folders. How can i use push over ssh to push n level of directories and all of their containing files to remote.
Related
Why git pull rebase does not update my local folder?
I have below groups in one of my Git version controlled iOS projects,
-- App
-- Libs
I see, for my project in Xcode, group name and physical folder name for Libs folder is same (i.e. CamelCased) but for all other team mates, the group shows CamelCased where their physical folder name is showing divergent (smallcase, libs). I have done git pull --rebase and got the latest of remote repository. But still the folder name does not get updated.
Inside Libs folder we have some library and surprisingly app is building fine for all members including me.
Why Git cannot detect the divergence between local physical folder and remote origin folder name? What should I need to do to make my local code exactly same as origin? Note that, when I clone the project in a new location, I see the folder name is small cased libs.
git prune did not help as well.
It seems git don't change case only changes.
If you want libs you can rename your local folder safely
if you want your team has Libs make a commit with the folder renamed _Libs and another one next after, with the folder renamed Libs.
I'm trying to copy files from Jenkins workspace to a remote server, but all the files were copied except .git and its related files are not copied.
I used Publish Over ssh plugin to copy file.
In the post build action, do this-> Check the No default excludes checkbox which is present under the Advanced section of Send build artifacts over SSH and it will upload your .git files. Please see the screenshot attached.
I'm working on an Xcode project and my brother wants to start helping out. I have the .git folder in my Xcode project directory, how can my brother pull / push / commit to / from my computer? Do I have to use OS X server and put the repo inside of there, or is there a simpler way to do this?
One simple option is to enable "remote login" in sharing, which enables ssh, then you can use the ssh protocol to clone the repository. Remote login preferences will tell you:
To log in to this computer remotely, type "ssh username#computer.local".
username#computer.local will be replaced with your username and hostname. In terminal, use:
git clone username#computer.local:[path]
on your brothers computer to clone the repo to him, where [path] is the path to the folder containing the repository. You will need to enter your password, and you will need to enter it in order to copy changes back later with git push or whatever.
You can set up passwordless ssh with private keys, but bear in mind that by doing this you are effectively giving your brother entire control of your computer.
If you want to push code between two non-bare repositores, I recommend having a look at git-annex.
It is usually used for syncing large files between repositories, but it also contains a nifty way of syncing non-bare repositories (pushes go to synced/master branch that is automatically merged).
Basically, if one can write a ls path or ssh [user#]host:path ls command that would list your repository, then you can use the corresponding git clone [[user#]host:]path [optionalNewName] to clone from it.
Also if he (or you) is working on the same local machine, or has access to the local filesystem, one need only point to either the .git directory or the directory containing the .git directory.
To make clone a repository into another directory:
git clone . ~/2015Archive/repositoryB # copy pwd's repository elsewhere
git clone .git ~/2015Archive/repositoryB # same
git clone ~path/path/repositoryA . # clone other repository into pwd
git clone /home/brother/2015/projects/CoolProject ~/WORK/BrosCode
# with ssh from a remote machine
git clone me#brosmachine:/home/brother/projects/CoolProject WORK/BrosLameCode
git clone me#brosmachine:../brother/projects/CoolProject WORK/BrosLameCode
If you change into the target repository and do a git remote -v it will show you an absolute path to the 'origin' from which it was cloned. If it was a local dir, it will be just a plain, absolute path. If it was accessed through ssh, it will be a ssh [user#]host:path identifier.
I have 2 rails applications that live inside the same git repo.
There is a shared folder where common logic lives.
- app_1
- shared
- app_2
The shared folder is really just a symlink to the appropriate places inside the app_1 folder. There is also a shared_public folder that is symlinked to app_1/public/files and app_2/public/files.
How can I do this? I'm open to anything, it's a clean slate. The project was never deployed previously, so I don't have a existing infrastructure to rely on. And splitting the shared logic out is (unfortunately) not an option currently, because of the timeframe I have to work with.
Git
When you mention the shared folder is a symlink - this only exists in operating systems, not git
Since git is just a deployment mechanism in this instance (I.E will place your files from your repo onto your server), you'll probably be able to do the following:
Initialize a git repo on your server ($ git init on your server)
Clone your github repo locally (git clone https://github.com.... on your local box)
CD into your new folder and add the server's repo as a remote
$ git push [server repo name] master
This isn't what you want, I know.
It will push your files onto your server - so you'll get the following folder structure:
app1
app2
The shared folder could then be created on your server itself.
If you have your appropriate server setup, you should be able to get this running from performing these steps
Capistrano
If you want to use Capistrano, you'll have to do something a little more involved, as this does more than just push your files to your server
If you want to use Capistrano, you'll have to split your app1 and app2 into separate applications, and deploy them individually. This will still allow you to create a symlink on your server, except you'll have a slightly different structure to your directories
I had created a remote repo with bitbucket.org, for example, https://somebody#bitbucket.org/somebody/test.git
When I pushed my local repo to the bitbucket repo by Eclipse EGit, I got all my project files in a parent directory, for example, https://somebody#bitbucket.org/somebody/test.git/Test/XXX. But I only hoped all my project files located in the repo root, for example, https://somebody#bitbucket.org/somebody/test.git/XXXX.
How can I do? Thanks!
eGit converts eclipse project into a folder under your Git repo when you 'share' it. This is the way eGit works, so I don't think what you asking is possible with eGit.
It is better this way IMO because such design allows for several projects in the same Git repository, which is very common.