How to upload project with mercurial on googlecode? - version-control

I have create a local directory, and made some sub-directories and file in it.
registered by project on code.google.com/hosting
install Mercurial and did > hg init
copied the auto-generated password from google, still dont know for what.
Now how do i upload files my local to the repository on google.
Tired googling a lot, almost all the information is available for SVN users.
Do i have to create a branch on mercurial first. I am sorry if it is too silly, but how do i create one, the site does say anything create or upload or add.
Can anyone please share, how he started/uploaded his project?

If you haven't created anything big in your local repo yet, the easiest way is the following.
Make a clone of the Google Code repository:
hg clone https://your_project.googlecode.com/hg your_local_repo
This will create a directory "your_local_repo" with a local repository in it. Make your changes here and
hg commit -m "Your commit message"
to commit the changes to your local repo. Then
hg push
to push the changes to the repository on GC.

Did you read this?
http://code.google.com/p/support/wiki/GettingStarted
http://code.google.com/p/support/wiki/MercurialStatus
http://code.google.com/p/support/wiki/MercurialFAQ

Related

How to merge local folder and its structure to github?

I am still a beginner and I locally made a folder of my Project and uploaded it as a repository in GitHub using GitHubDesktop. Now I changed the structure of the files (deleted some sub-folders and moved files here and there locally). Now I don't see those changes in my GitHubDesktopas something which I can push to the GitHub online and reflect the changes there.
I am not sure how to achieve that:
(One way I can think is to reclone and download the online GitHub repository to local, move the changed files again and then commit from GitHubDesktop) , but I am not sure if it will work because I did the almost the same thing just without recloning: but after the reorganization, the changes are not appearing in my GitHubDekstop which I can commit.
Any advice would be great. Thank you.
This is my repository (https://github.com/grammilo/Codes) whose organization I want to copy from a local folder which goes by the same name and was previously cloned from it.
When you go to the directory of the repository in your terminal, checkout your master branch
git checkout master
and use
git diff
this will display any changes made to the files and file structure in green and red. You can delete folders and files directly from your file system or from the terminal, whichever you prefer and these changes will display when you use git diff. After your changes are made use
git add
this will stage your changes to be committed. You can use
git status
to make sure your changes are ones you would like to make.
Use
git pull
to pull any changes from your repository and when you are ready to commit your changes simply use
git push origin master
this will commit your changes to the remote repository on GitHub from your command line without using GitHub Desktop. Check out the git documentation for more in depth explanations but that should achieve what you're looking for.

How can collaborators push their changes to my repo in GitHub

First I have created one project in Eclipse and committed to my GitHub using below commands:git init
git add .
git commit -m "first commit"
git remote add origin URI of my repo
git push -u origin master
Then I modified one file in Eclipse and committed to GitHub from Eclipse through creating remote and giving the remote URI of the repo.
I added my team member through add collaborator.
Then he downloaded my project and made a change in a file in Eclipse.
Now, how can he push that modified file to my GitHub repository from within Eclipse?
We have done one thing. He created a remote and gave the URI of my repo. But still we are unable to commit that file.
You need to add your colleague as a collaborator. This can be done in the desired GitHub repo via Settings > Collaborators (you need to type in your password again). Afterwards they have those permissions.
UPDATE
Sorry and good morning ;)
I overlooked that you already added your partner as a collaborator. Another possible reason for your situation could be in the Temporary interaction limits where you can, amongst others, limit the interaction with your repo to prior contributors.
If that doesn't help. Please add some more informations about your colleague's git logs.
UPDATE 2
#Rahul K regarding your comment (which you better add to your question, for faster recognition), your colleague first needs to integrate the remote changes via git pull origin master in order to be able to push his or her changes afterwards. But be aware that he or she might need to migrate any conflicts to files both of you applied changes to.
Best regards, David
I have resolved the issue by cloning the repo in my local folder, adding the project to eclipse and changing the file committed.
Before that you have to add that person as a collaborator. So that he/she can clone your repo using the command below:
git clone "Path to the repository"
This is an old question but I'll like to say this to help others that might still be facing this same issue.
I also faced this issue with a friend. I already made him a collaborator but he couldn't push. What we did to solve it was to clone the repo using the ssh url instead. Then we set up authentication in git with ssh. And we were able push successfully.
If you already cloned the repo with the usual HTTPS url, you can change the remote origin url using the git remote set-url origin <url> command but url here will be the ssh url.

How to upload folders on GitHub

How can I upload folders to GitHub? I have all of my code in a folder, containing 98 files, on my desktop. I know how to upload files, but it there a way to upload the entire folder?
Thanks!
This is Web GUI of a GitHub repository:
Drag and drop your folder to the above area. When you upload too much folder/files, GitHub will notice you:
Yowza, that’s a lot of files. Try again with fewer than 100 files.
and add commit message
And press button Commit changes is the last step.
You can also use the command line, Change directory where your folder is located then type the following :
git init
git add <folder1> <folder2> <etc.>
git commit -m "Your message about the commit"
git remote add origin https://github.com/yourUsername/yourRepository.git
git push -u origin master
git push origin master
I Understand where you are coming from.
The solution provided by #James Graham may not work in certain cases. The Drag and Drop Functionality may cease to exist. See below link when that happens:
https://www.reddit.com/r/github/comments/meuxtg/github_drag_and_drop_not_working/
If somebody wants to avoid the shell and all the commands and wants to have a UI to do that,Github Desktop is one of the way to go forward.
Steps to follow to install and use Github Desktop:
I am assuming you know the difference between local repo and remote repo
Install Github Desktop
Create a repository locally on your hard drive by using github desktop. This will automatically create files like .git and .gitattributes. It also asks to create a README.md file, always best practice is to create it and edit it informing readers about your project overview, installation steps etc. README.md is rendered in Markdown and can also render HTML. See more about Markdown here: Markdown Cheatsheet guide
Copy and Paste all the folders and files that you want to upload(basically the right terminology is "Push" ) into this newly created local repository. Be aware of the directory structure as the exact same directory structure will be replicated on your remote repository.
Go to github desktop, as soon as you paste files in the local repo, you will see them as changes here. All you need to do is commit these changes with a comment. This will be your "First or Initial Commit" to the repo.
Next Github repo will ask whether you want to publish these to its remote repository. Click "Publish" Note Publish is just a one time operations. Going forward any further changes you make to local repo will be seen in github desktop and you need to again follow the loop of "Commit local->Fetch from remote->Push to Remote. As long as you are the only developer working on a project you need not go into other mechanics of git branches etc.
To verify if your repo is published remotely login to your github profile on the web and see your repository sitting there. This your remote repo which you effectively created from your local repo by using Github desktop.
I've just gone through that process again. Always end up cloning the repo locally, upload the folder I want to have in that repo to that cloned location, commit the changes and then push it.
Note that if you're dealing with large files, you'll need to consider using something like Git LFS.
For those still using master, this was changed to main
echo "# repo-name" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/username/repo-name.git
git push -u origin main

Synchronizing copied repository with GIT repository

I have copied repository from my team member and I want to synchronize with GIT repository.
Please keep in mind that I am new to GIT and I only have URLs of the repository where I need to synchronize. I need help to connect my repository with GIT repository. I have not imported any repository and I have just copied that. I will be able to push or pull or merge etc. only if my project is synchronized with remote repository. Please let me know that how can I synchronize. Thanks
It's unclear from your question whether you are trying to simply keep two copies of the same repository synchronized or something else.
If it's the first, then what you want to do it a git clone. Your changes should be git commit, to get remote changes you should git pull and to push your changes to your co-worker's repository, you should git push.
Depending on your operating system, there are different front-ends for Git. I gave you the command-line version. I saw you tagged your questions with the eclipse tag, which suggests you are trying to do this inside Eclipse. In that case, you might find EGit useful. See the EGit User Guide here.
If all this sounds too complex for you, you should first Read The Manual - that is, check out the Getting Started chapter of the Git Documentation.
I found the solution. I had to go in team-> share projects. then "create a new repository location" and paste the url of git repository. then team->share project-> git and add the repository. Now my copied repository is linked/connected with my git repository and I am able to synchronize my repository.

Stopped Using Git - Now Want to Start Again. How to Get Synced Back Up?

We had a number of developers working on a large website project using Git. We have a GitHub repository and then we have the website on the server, plus all the developers have their local versions.
When we finally launched the project, I got lazy (hangs head in shame) and started making changes directly to the server, without pushing them back to the Github repo. However, other people made changes to the repo, for reasons I don't quite understand, that were never pushed down to the server and are now either outdated or wrong. We have been doing this for almost seven months.
Now the server and repo are hopelessly out of sync. I would now like to get the most updated version of the site (which is the server) back up to the Git repository so we can begin another round of development. I basically want to start with a fresh copy of what is on the server.
How would you recommend I proceed? That was the first time I had used Git. It didn't seem like such a big deal at the time but now seems like it is harder to start up again than I thought.
I have looked for instructions and don't really see anything that fits. Because I am not super confident in my Git skills, I am afraid to just start trying the few ideas I did find and losing what I have on the server.
(I know I could restore from a backup if I really messed it up but would prefer not to do that as it would take the site down.)
Can I uninstall git and start again with a fresh repo? Or is there a safe way to push the current version up to the repo?
Thanks for your help.
UPDATE: I found this answer elsewhere (Replace GitHub repo while preserving issues, wiki, etc) but I am not sure how to do this:
cd into "new" repository
git remote add origin git#github.com:myusername/myrepository (replacing myusername & myrepository accordingly)
git push --force origin master
Possibly delete other remote branches and push new ones.
Not sure what they mean by "new repository"
Make a new branch and push it to GH.
Make a new branch based on the previous
branch.
Switch to the new branch (created on #2).
Delete all the files and folders on this branch repository
except the .git folder and contains
(maintain the README.md,
.gitignore and other files if you want it).
Copy all the files from the server except
.git folder.
Commit.
Switch to local Master (created on #1)
Merge this new branch with the previous one.
Solve conflicts
(I use SmartGITthat have a visual conflict solver and helps me a lot, but you can use gitdiffif you don't want a visual interface)
Commit
Push it to GH.
I hope this helps
I figured this out. What I did was:
Make a new branch on Github to effectively store a backup.
$ git add . to stage all changes
$ git commit -m "Commit message" to commit changes
$ git push --force origin master to force changes from server to remote branch master
Once I did this, there were still hundreds of files I had deleted on the server that were not reflected on the remote github.com repository. I used the following:
$ git rm $(git ls-files --deleted)
See Removing multiple files from a Git repo that have already been deleted from disk
Then repeated git commit and git push. Now my github repo matches my server exactly.
I have not yet deleted the "backup" branch I created on github but I will.
Hope that helps someone.