-
Notifications
You must be signed in to change notification settings - Fork 0
How To
This is the fastest way to get help in this class! But, it only works if you give others enough information to help. Here's how:
- Start a new Q&A discussion
- Write a detailed description of your problem. You should include:
- What you were trying to do / what you expected to happen
- What you did
- What actually happened
- Details about your set up -- important details can include the platform, operating system, software and library versions
- Support your description with FULL error messages, minimal reproducible code examples, and/or screenshots.
- Tag anyone you would like to look at your question using
@username
syntax.
You can save work to GitHub by 1) committing and 2) pushing/syncing your work to GitHub. It's a good practice to do this every time you do a chunk of work, in order to take the best advantage of version control -- but you will definitely need to do it to submit progress GitHub Classroom assignments!
-
Navigate to the Source Control tab on the left
-
Write a note in the box that says 'Message'
-
Click
Commit
-
Click
Sync
-
You should now see your changes reflected in your repository on GitHub (NOT just in the Codespace!)
NOTE: If you have changes pushed to your remote repository (this is what you see when you open up your repository on GitHub), you may need to first select ...
> Pull
> Pull (Rebase)
. This is the most common problem we see for folks who are trying to Sync from Codespaces, and it's a tricky one -- some folks have run into small changes they didn't make, possibly from GitHub Classroom or maybe the process of opening a Codespace itself.
Open up your Codespace again and commit/sync using the instructions above. Your work should still be there as long as the Codespace has not been deleted!
Video coming soon!
- Open GitHub Desktop, and select the repository you want to sync.
- Write a message for your commit.
- Click
Commit
. - Click
Push
.
NOTE that you may need to pull changes down from GitHub before pushing! GitHub desktop has a graphic user interface for merging any conflicts, but try not to make changes to the same file in different locations to avoid gnarly conflicts.
Video coming soon!
The command line git
tools are very powerful, but the process can get a little spicy! If you're new to git, you might want to make a backup copy of your work before messing around with git on the command line.
- Open a terminal and navigate to your GitHub repository
- Run
git status
and follow the suggested commands if any. Make sure that no files you don't want to track (like .ipynb_checkpoints folders) are included in the listed changes. If they are you can add them to the.gitignore
file. - Run
git add .
, or replace the.
with individual files you want to track. This tellsgit
to pay attention to changes in the specified files. - Check
git status
again to make sure that you really want all the changes that areStaged to commit
. - Run
git commit -m "some message here", replacing
some message herewith your commit message. If you forget and get stuck in vim (you'll know because you'll see an empty file and typing will do weird stuff, or nothing), then go ahead and type
ESC - Check
git status
again to make sure your commit went through. - Run
git push
. If it doesn't work, check the suggested commands in the output -- they're usually right about the next step!
NOTE that you always want to carefully read the outputs of any git
command, and it's usually a good idea to follow any instructions there. Don't assume that your commands completed successfully because you see the command line prompt again -- that's not how the command line informs you of errors and warnings!