Home > Software engineering >  What if I just commit and do not push on Git?
What if I just commit and do not push on Git?

Time:05-29

I am still curious and do not know how Git works. And I was wondering what if I just committed my files and did not push them.

CodePudding user response:

In the case where you commit, but do not git push the commit anywhere, that means that only you have that commit.

That's not the right thing to do, nor is it the wrong thing to do. It is merely a thing you can do. You can keep all your commits to yourself as much as you like. If you don't want anyone else to have them, don't send them to anyone else.

If you do want someone else to have access to your commits, though, then you'll want to send them off, probably with git push.

CodePudding user response:

To do anything in GitHub, you’ll need to know how to first start a repository. A repository (or repo) is essentially synonymous with the word “project.” Quite simply, a repository stores everything pertinent to a specific project including files, images, spreadsheets, data sets, and videos, often sorted into files. It’s best to include a README file within your repository that has specific information regarding the given project. On GitHub, you can add a README file right when you create a new repository.

To create a new repository, you’ll hit “new repository” in the upper-right-hand corner. You can then name your repository, include a brief description, and check the box that says “initialize this repository with a README.” Finally, you’ll click “create repository.”

Steps

  1. On GitHub.com, navigate to the main page of the repository.
  2. Above the list of files, using the Add file drop-down, click Upload files. 3.Drag and drop the file or folder you'd like to upload to your repository onto the file tree.

At the bottom of the page, type a short, meaningful commit message that describes the change you made to the file. 5.Below the commit message fields, decide whether to add your commit to the current branch or to a new branch. If your current branch is the default branch, you should choose to create a new branch for your commit and then create a pull request. 6.Click Commit changes.

  • Related