Move code to git from local machine
I have my git repository created given by senior person. Now I want to upload my local source code to that repository. Which steps I need to follow? Is there any standard doc for that? My source code is in C#.
See also questions close to this topic
-
Merge The same remote Git Branch into local Branch
I'm currently working on a jee project, using git.
my local workspace is linked to a git branch called "branch1". As I made multiple changes in my local workspace over a few days, without checking or verify the remote status of the branch1, someone acceseed the same remote branche while I was working locally and made change in the remote branch1.
my problem is how do I merge those changes into my local branch without losing anything ? PS: i've already tried merging, but git asks to commit the changes before the merge, which is not good.
-
Change existing release artifacts on github from travis
I am trying to publish an apk from travis to github releases, which is working great, but I don't want to create different tags every time travis makes a build and publish.
I was trying to delete the remote tag from the build which lead to "invalid credentials" error, and
override: true
also lead to nothing.Here is my .travis.yml:
language: android before_script: - mkdir -p "$ANDROID_HOME/licenses" - cp .android-licenses/ "$ANDROID_HOME/licenses/" script: - "./gradlew build" android: components: - tools - platform-tools - tools - build-tools-27.0.3 - android-27 - extra-google-m2repository - extra-android-m2repository - addon-google_apis-google-27 before_deploy: - git config --local user.name "TRAVIS-CI" - git config --local user.email [email] - git tag -d latest - git tag latest deploy: provider: releases overwrite: true api_key: secure: [encrypted token] file: app/build/outputs/apk/release/release.apk skip_cleanup: true on: repo: ariedov/TheTaleClient
-
How can I pipe output from git log in Git Bash?
Reason: I want to compare two arbitrary different commits using a difftool. I know the hashes from a search and I don't want to copy these hashes, thus I am looking for a command that does something like
$ log_str=$(git log --all -S"new_tour <-" --pretty=format:"%h") $ git difftool -t kdiff3 log_str[1] log_str[2] myfile.txt
- I would like to be able to address arbitrary indices - not always 1 and 2
- It would be great if the answer also gives a hint, how to figure out, what the structure of
log_str
is. Is it a character? An array of characters? A list? ... using the Bash.
I found some related help here and here, but I can't make it work.
Now I do:$ git log --pretty=format:"%h" 3f69dc7 b8242c6 01aa74f 903c5aa 069cfc5
and
$ git difftool -t kdiff3 3f69dc7 b8242c6 myfile.txt
-
lerna publish on Jenkins "git remote update" Fails "Could not read from remote repository."
I am trying to set up
lerna
withjenkins
to publish after all my tests pass. I have the command running but it's failing.I can't find any documentation on how to get this to work. I need this command to have access to push the lerna tags, as well as the updated version numbers to the master branch, and I also need Jenkins to not fall into an infinite loop.
My first issue was this:
> lerna publish --yes --cd-version=patch lerna info version 3.0.0-beta.17 lerna info versioning independent lerna ERR! ENOGIT Detached git HEAD, please checkout a branch to publish changes. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! abide@1.0.0 publish: `lerna publish --yes --cd-version=patch` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the abide@1.0.0 publish script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /var/lib/jenkins/.npm/_logs/2018-04-24T03_18_59_152Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! abide@1.0.0 jenkins: `npm run versions && npm run test && npm run publish` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the abide@1.0.0 jenkins script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /var/lib/jenkins/.npm/_logs/2018-04-24T03_18_59_167Z-debug.log Build step 'Execute shell' marked build as failure Finished: FAILURE
Which I fixed by doing this: Jenkins Git plugin detached HEAD
Here's what I set everything to:
Now I am having this issue:
> lerna publish --yes --cd-version=patch lerna info version 3.0.0-beta.17 lerna info versioning independent lerna ERR! Error: Command failed: git remote update lerna ERR! Permission denied (publickey). lerna ERR! fatal: Could not read from remote repository. lerna ERR! lerna ERR! Please make sure you have the correct access rights lerna ERR! and the repository exists. lerna ERR! error: Could not fetch origin lerna ERR! lerna ERR! Fetching origin lerna ERR! lerna ERR! at makeError (/var/lib/jenkins/workspace/abide/node_modules/@lerna/child-process/node_modules/execa/index.js:169:9) lerna ERR! at Function.module.exports.sync (/var/lib/jenkins/workspace/abide/node_modules/@lerna/child-process/node_modules/execa/index.js:338:15) lerna ERR! at Object.execSync (/var/lib/jenkins/workspace/abide/node_modules/@lerna/child-process/index.js:21:16) lerna ERR! at Object.isBehindUpstream (/var/lib/jenkins/workspace/abide/node_modules/@lerna/git-utils/index.js:206:25) lerna ERR! at PublishCommand.initialize (/var/lib/jenkins/workspace/abide/node_modules/@lerna/publish/index.js:92:24) lerna ERR! at Promise.resolve.then (/var/lib/jenkins/workspace/abide/node_modules/@lerna/command/index.js:228:24) lerna ERR! lerna Command failed: git remote update lerna ERR! lerna Permission denied (publickey). lerna ERR! lerna fatal: Could not read from remote repository. lerna ERR! lerna lerna ERR! lerna Please make sure you have the correct access rights lerna ERR! lerna and the repository exists. lerna ERR! lerna error: Could not fetch origin lerna ERR! lerna lerna ERR! lerna Fetching origin lerna ERR! lerna npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! abide@1.0.0 publish: `lerna publish --yes --cd-version=patch` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the abide@1.0.0 publish script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /var/lib/jenkins/.npm/_logs/2018-04-24T03_29_06_133Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! abide@1.0.0 jenkins: `npm run versions && npm run test && npm run publish` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the abide@1.0.0 jenkins script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /var/lib/jenkins/.npm/_logs/2018-04-24T03_29_06_144Z-debug.log Build step 'Execute shell' marked build as failure Finished: FAILURE
How can I get
lerna publish
to work in Jenkins? -
Artifactory github Repository - downloadBranch
I have github setup as a VCS repository in Artifactory. When using the
downloadBrach
API through Artifactory (similar to downloading files viagit clone
), the download appears to include everything except the dot hidden files (.gitignore is an example).Is there a way to include all files (including the dot hidden files) when downloading a branch from an Artifactory VCS repository?
This is what I've tried:
curl -XGET "https://artifactory.domainname.com/artifactory/api/vcs/downloadBranch/github-remote-vcs/jquery/jquery/master" -o jqueryMaster.tar.gz
This results in a gzipped tarball that contains all files in the repo, except for the dot hidden files but I need all files in the repo.
-
Git how to revert staged /unstaged modified file
In Git(2.16). Suppose, I modified a single file and did not stage yet I would like to revert the file back to original? Also, how can I accomplish this on a staged file? Thanks.