in Education by
I created a local branch that I want to 'push' upstream. There is a similar question here on Stack Overflow on how to track a newly created remote branch. However, my workflow is slightly different. First I want to create a local branch, and I will only push it upstream when I'm satisfied and want to share my branch. How would I do that? (my google searches did not seem to come up with anything). How would I tell my colleagues to pull it from the upstream repository? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
If you want to create a branch from the current branch git checkout -b {your_local_branch_name} For creating a branch from a remote branch git checkout -b {your_local_branch_name} origin/ After editing the files git add -A or git add git commit -m 'your commit message' git push -u origin Which basically add, commit and pushes your file For updating git pull origin master For more information please go through the following tutorial to get more info about git:

Related questions

0 votes
    I cloned a Git repository, which contains about five branches. However, when I do git branch I only see one of ... staging * etc... Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I want to merge two branches that have been separated for a while and wanted to know which files have been modified ... I missed... Select the correct answer from above options...
asked Feb 3, 2022 in Education by JackTerrance
0 votes
    I don't want to rename a remote branch, as described in the Rename master branch for both local and remote ... and remote branch name Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    How do you delete untracked local files from your current working tree? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I create a new branch in Git: git branch my_branch push it: git push origin my_branch Now say someone made ... the default behavior? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I started some work on a new feature and after coding for a bit, I decided this feature should be on its ... on the new feature. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    My git workspace is dirty, there are some local modifications. When I use the command git pull origin master it ... Ansible git module? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I would like to know how to delete a commit. By delete, I mean it is as if I didn't make that commit, ... -hard HEAD. Is this correct? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How do you delete a Git tag that has already been pushed? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, ... those forks I pulled? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git ... for a single project. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    How do I discard changes in my working copy that are not in the index? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    How do I revert from my current state to a snapshot made on a certain commit? If I do git log, then I get ... , i.e. commit 0d1d7fc? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    What does the command git reset –hard HEAD ~3 do? A. Merges the last 3 commits to the master B. Discards ... nothing D. Resets the head to 3 commits before the current commit...
asked Dec 23, 2022 in Technology by JackTerrance
0 votes
    I've been wondering whether there is a good "git export" solution that creates a copy of a tree without the . ... tree into the index. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
...