Original answer
You cannot create an empty folder and then add files to that folder, but rather creation of a folder must happen together with adding of at least a single file. This is because git doesn't track empty folders.
Git doesn't store empty folders. Just make sure there's a file in the folder like doc/foo.txt and run git add doc or git add doc/foo.txt, and the folder will be added to your local repository once you've committed (and appear on GitHub once you've pushed it).
Go to the folder inside which you want to create another folderClick on New fileOn the text field for the file name, first write the folder name you want to createThen type /. This creates a folderYou can add more folders similarly
I have a folder with all my files set up for a project.I decided to use git on that folder, so I created on Github an empty repo.Usually the procedure is to clone on my local disk the remote repo, and in this case it will create an empty folder. But, what I want to do is to fill the remote repo with my project folder without harming and without moving it.Is there a procedure to do that?
If you still end up with errors like "Updates were rejected because the remote contains work that you do not have locally", this is normally because that the remote repo is recently created manually. Make sure you are not overwriting anything on the remote end before you force push local git folder to it using
What is the step or process of adding a file from my RStudio to one of my github repository? I searched in the internet. But, they provide vague steps on how to do it using RStudio. Can someone help me on how to add my file from RStudio to one of my github repo just by using the git in RStudio?
My friend I need both aspect and subsequent steps for beginner like me. I am still confused on how to do it. Though, I watch tutorial video. Most of the videos do not provide the small details for beginners like me. I tried to commit some of my files to the repository of my github account using Rstudio via Git Version Control. But, it gives me error, like this one below.
To GitHub - alhakimdata/case-study
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'GitHub - alhakimdata/case-study'
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.
I have 3 repositories from my github account. I made it 3 because one of it is for my case study. The other one is for my data analysis practices/exercises. The other one is for projects in the near future.
Can I commit and push my codes from RStudio to my github repositories using a personal access token by generating a token from my github account? Is it one of the ways on how to commit and push it to repos?
C:/Program Files/Git/bin/git.exe pull
error: The following untracked working tree files would be overwritten by merge:
README.md
Please move or remove them before you merge.
Aborting
Merge with strategy ort failed.
I was able to push it using the git push -f origin main in the RStudio terminal. But, the problem is that, it was put to the wrong repository. How can I put my code to the right repository I created? I have 3 repositories. How can I change the repository in RStudio?
Do I need to change the repository of my RStudio? So that I can commit and push my code to the right repository in my github account? I am confused already, my friend. It's been hours thinking what should I do. Tried to commit it using the git push -f origin main. But, it was pushed to the wrong repository. It should be commit and push to the right repository of my github account.
In RStudio, you can look in the menu Tools -> Project Options -> Git/SVN to see which repository you project is tracking. You can push to other repositories from the command line. In the Terminal in RStudio, run
and you should see information about the repository listed under Tools -> Project Options -> Git/SVN. You can add repositories with git remote add. See the book I linked or other documentation. You can push to a particular repository with git push RepoName BranchName. Those are just hints. Please study some documentation.
Thank you for the reply. I appreciate it. I will try to read the link you provided. But, of course. I was thinking that I only want to learn how to commit, push my code in my github repos. Then, learn how to edit it back to RStudio, learn how to delete files from repos. I guess, however, I need to learn all about the git. I was thinking to learn those things that I needed as a new data analyst, not the whole process of it. Because it will take time and not all are needed. But, thank you for your effort on replying.
By the way, can I ask you about the initialized folder of my files. Do I need to keep on creating new folder (blank folder from my pc). Then, initialize it. And then, used it to all files under that one folder? Or should I create one folder. Then, I'll create sub folder inside of that folder for every project I make?
Think of every project in RStudio (menu File -> New Project) as its own repository. When RStudio sets up the project, it will either make a new folder or you can direct it to use an existing folder. That folder should be dedicated to materials for that one project. RStudio will handle initiating the Git files if you select to use Git with the project. Similarly, any remote repository on GItHub or any other location should be dedicated to that project.
Thank you! I appreciate it. Thank you to those who replied to my post. I am new to R and Git. I want to change a career to become a data analyst. That is why I joined in this community because I wanted to learn the ins and outs. So, I am your new neighborhood, spidata analyst.
This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.
Easy. Go to your github account and click the button to create a new repo. I typically do not initialize with the .gitignore, readme.md, or license.md files, but add them myself manually after the project is up and running.
Click the Git tab in Rstudio, and then click Commit. This will open a window where you can stage files to be tracked (and synced on GitHub). Select all the files you would like to track, write a commit message, then click push. This will send all changes to the GitHub repo.
For Arduino Ide on a Windows 10 laptop, I want to relocate Arduino and ArduinoData folders from the Documents folder to a folder inside of a GitHub Project so I can do version control and share development with another remote person via GitHub.
C:\Usersuser name\Documents\Arduino is the default sketchbook folder location. The sketchbook folder location is stored in a file named preferences.txt under the sketchbook.path property. You can find the location of preferences.txt at the line following File > Preferences > More preferences can be edited directly in the file.
You can change the sketchbook folder location in the Arduino IDE at File > Preferences > Sketchbook location. Or edit preferences.txt if you prefer, but be sure to close all Arduino IDE windows first.
When using the Microsoft Store app version of the Arduino IDE, I don't think there is any way to change the data folder location. However, if you use the "Windows Installer, for Windows XP and up" or the "Windows ZIP file for non admin install" links on the Downloads page, and install the Arduino IDE outside the C:\Program Files (x86) or C:\Program Files folders (because Windows 10 puts more strict security restrictions on those folders), you can run the Arduino IDE in portable mode:
That will cause the portable subfolder of the Arduino IDE installation folder to be used as the data folder. You are still stuck with that specific location, but you can install the Arduino IDE anywhere you like, so this gives you some flexibility over where that folder is located.
Version control really isn't meant to be done with binary files like you fill find in the ArduinoData folder, and especially not with the large binaries you find there. Your repository will get huge very quickly, which will make it very annoying to work with. GitHub doesn't guarantee they will allow repositories to exceed 1 GB.
There really isn't anything in ArduinoData that needs to be version controlled. Maybe preferences.txt, but it's probably much less effort to just redo your preferences if there is a problem than version controlling that file.
Even when it comes to the sketchbook folder, I wouldn't recommend version controlling the whole folder as a single repository. That would make for a very messy and confusing commit history. GitHub allows you to have as many free repositories as you like, so make one repository for each custom sketch and custom library.
RStudio is a popular integrated development environment for R. It integrates the tools you use with R into a single environment. GitHub Pages allows you to host websites directly from your GitHub repository.
Commit your file. Replace with a log message describing the changes, for example Knit output to a docs folder. A commit tells Git to collect all of the files in the staging area and store them to version control as a single unit of work:
Note: GitHub Pages sites are always public when hosted on GitHub.com. If you want to share a site with a select number of people you can use Jekyll Auth. On GitHub Enterprise users need to authenticate to access GitHub Pages sites when private mode is enabled.
How do I copy the files from github into HA? If have tried creating new files with the same names in the custom directory then copy and pasting the text across, but this does not seem to work and the names of the files are highlighted in red?
c80f0f1006