Thủ Thuật Hướng dẫn Add project to GitHub Desktop Mới Nhất
Pro đang tìm kiếm từ khóa Add project to GitHub Desktop được Update vào lúc : 2022-12-19 18:22:06 . Với phương châm chia sẻ Bí kíp Hướng dẫn trong nội dung bài viết một cách Chi Tiết 2022. Nếu sau khi tìm hiểu thêm nội dung bài viết vẫn ko hiểu thì hoàn toàn có thể lại Comments ở cuối bài để Ad lý giải và hướng dẫn lại nha.
Creating repositories using GitHub Desktop¶
We will practice creating a new repository using GitHub Desktop, committing changes to it, browsing the changes, creating branches, and more. This is practically the same as the previous episode, but we introduce some new concepts:
Nội dung chính
- Creating repositories using GitHub Desktop¶Step 1: Create an example spreadsheet¶Step 2: Initialize a repository with GitHub Desktop¶Step 3: Commit the CSV data file¶Step 4: Publish the repository on GitHub¶Step 5: Create a branch, commit to it, and share it¶Step 6: Fetch and pull changes from the web¶
There are now two copies of your repository: that on your computer, and that on Github.
We introduce the concepts of pull and fetch to move code GitHublocal, and push to move code localGitHub.
GitHub Desktop is a application that lets you manage files with Git. It is not the only way to use Git, but it is easy and integrated, so its a nice thing to teach.
One can share existing projects also using the web interface, so GitHub Desktop is not the only way to make an existing project available on GitHub.
In small groups it can be useful to do this side by side (in-person) or one learner shares their screen (video) and others can ask questions and give suggestions. In a larger group the instructor can demonstrate these and then participants can try on their own and then ask questions.
Step 1: Create an example spreadsheet¶
In this exercise, we will share a data file in CSV (comma-separated values) format and see how GitHub nicely displays it. First, we need to make some CSV file.
Either create a new CSV file:
Create a spreadsheet with Excel/LibreOffice or similar, containing some fantasy data
Export the spreadsheet to CSV format
If you dont feel like creating a new CSV file, you can tải về an example here:
Right-click and Save as
Make sure the file is actually in CSV format, not Excel/spreadsheet format.
Step 2: Initialize a repository with GitHub Desktop¶
First, we make a new local repository. At this stage, the repository will only exist on our computer, not yet on GitHub.
Start GitHub Desktop
Click on + Create a New Repository on your hard drive
Step 3: Commit the CSV data file¶
Now, we add the CSV to git. First, we put it in the git directory, then tell git to save it.
Copy your (own or downloaded) CSV file to the repository thư mục
Note how GitHub desktop changed and shows you the changes
Make a commit
Step 4: Publish the repository on GitHub¶
This is the step where we actually upload it to Github. Github Desktop lets us create a new repository on github without using the web browser. In this step, we also push the changes to the remote repository, though it happens without us seeing all the middle steps.
Browse the history (click History)
Dont use the same name as the previous episode
You can choose between a private and a public repository
Click Publish repository (this only publishes the current branch)
After you have pushed, visit the repository via the website
Step 5: Create a branch, commit to it, and share it¶
This is pretty much the normal work: edit a file, commit it. But, in this case, we are going to commit it to a new branch. Why? Well see later.
Make a change to the CSV file directly on your computer, but do not commit yet
Observe the change you made in GitHub Desktop before committing
Create a new branch on GitHub Desktop
Bring my changes to the new branch:
Commit to the new branch on GitHub Desktop
Publish the new branch to GitHub
Browse your branches and changes on GitHub
Step 6: Fetch and pull changes from the web¶
Now we show how to fetch or pull code from Githublocal.
Edit the file via the GitHub web interface and commit there to master
Switch to GitHub Desktop
Change current branch to master
Click Fetch origin
Before continuing compare the histories on your computer and the network on GitHub and discuss what fetch did:
Click Pull origin
After pulling browse the History in GitHub Desktop
Whats the difference between fetch and pull? Fetch gets the changes, but doesnt apply them locally. Pull = fetch + apply changes locally in your current repository (does a merge which we will discuss later).
Summary
With Github Desktop, we can do everything we can on the web, but its more natural. The most important concepts are that of remotes (links between repositories), pushing, and pulling.
We dont cover it in this workshop, but you can eventually do all of these things from the command line, for example git commit some_file.csv. Once you are doing many things, this can be faster. Still, theres almost always a place for applications like the GitHub Desktop and other graphical user interfaces to make things smoother.
Reply
0
0
Chia sẻ
Video Add project to GitHub Desktop ?
Bạn vừa tìm hiểu thêm tài liệu Với Một số hướng dẫn một cách rõ ràng hơn về Clip Add project to GitHub Desktop tiên tiến và phát triển nhất
Share Link Tải Add project to GitHub Desktop miễn phí
You đang tìm một số trong những Share Link Cập nhật Add project to GitHub Desktop miễn phí.
Giải đáp vướng mắc về Add project to GitHub Desktop
Nếu Pro sau khi đọc nội dung bài viết Add project to GitHub Desktop , bạn vẫn chưa hiểu thì hoàn toàn có thể lại Comments ở cuối bài để Admin lý giải và hướng dẫn lại nha
#Add #project #GitHub #Desktop